Fix bug when editing a problem
[vchess.git] / client / src / views / Problems.vue
index cfc0637..9ce2b3f 100644 (file)
@@ -144,11 +144,11 @@ export default {
       problems: { "mine": [], "others": [] },
       // timestamp of oldest showed problem:
       cursor: {
-        "mine": Number.MAX_SAFE_INTEGER,
-        "others": Number.MAX_SAFE_INTEGER
+        mine: Number.MAX_SAFE_INTEGER,
+        others: Number.MAX_SAFE_INTEGER
       },
       // hasMore == TRUE: a priori there could be more problems to load
-      hasMore: { "mine": true, "others": true },
+      hasMore: { mine: true, others: true },
       onlyMine: false,
       showOne: false,
       infoMsg: "",
@@ -371,7 +371,7 @@ export default {
           data: { prob: this.curproblem },
           success: (ret) => {
             if (edit) {
-              let editedP = this.problems.find(p => p.id == this.curproblem.id);
+              let editedP = this.problems["mine"].find(p => p.id == this.curproblem.id);
               this.copyProblem(this.curproblem, editedP);
               this.showProblem(editedP);
             }