X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FProblems.vue;h=152e455fa46ffdd005f1791d00346a2aee28f30c;hb=57b3f30ea30a2c6794da7995659985a186fcd4ea;hp=3a700eabfd56887c9219225cf213c89bfb54d1ec;hpb=866842c3c310524c034922870234120ed2a16cbf;p=vchess.git diff --git a/client/src/views/Problems.vue b/client/src/views/Problems.vue index 3a700eab..152e455f 100644 --- a/client/src/views/Problems.vue +++ b/client/src/views/Problems.vue @@ -306,16 +306,18 @@ export default { if (edit) { let editedP = this.problems.find(p => p.id == this.curproblem.id); this.copyProblem(this.curproblem, editedP); - } //new problem + } else { + // New problem let newProblem = Object.assign({}, this.curproblem); newProblem.id = ret.id; newProblem.uid = this.st.user.id; newProblem.uname = this.st.user.name; - this.problems = this.problems.concat(newProblem); + this.problems = [newProblem].concat(this.problems); + this.resetCurProb(); } - this.resetCurProb(); this.infoMsg = ""; + document.getElementById("modalNewprob").checked = false; } ); },