projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generalize pawn movements: cleaner and smaller code
[vchess.git]
/
client
/
src
/
views
/
Problems.vue
diff --git
a/client/src/views/Problems.vue
b/client/src/views/Problems.vue
index
2ea875e
..
ae918b9
100644
(file)
--- a/
client/src/views/Problems.vue
+++ b/
client/src/views/Problems.vue
@@
-284,10
+284,12
@@
export default {
// Condition: vid is a valid variant ID
this.loadedVar = 0;
const variant = this.st.variants.find(v => v.id == vid);
// Condition: vid is a valid variant ID
this.loadedVar = 0;
const variant = this.st.variants.find(v => v.id == vid);
- const vModule = await import("@/variants/" + variant.name + ".js");
- window.V = vModule.VariantRules;
- this.loadedVar = vid;
- cb();
+ await import("@/variants/" + variant.name + ".js")
+ .then((vModule) => {
+ window.V = vModule[variant.name + "Rules"];
+ this.loadedVar = vid;
+ cb();
+ });
},
trySetDiagram: function(prob) {
// Problem edit: FEN could be wrong or incomplete,
},
trySetDiagram: function(prob) {
// Problem edit: FEN could be wrong or incomplete,