X-Git-Url: https://git.auder.net/images/pieces/%22%20%20V.getPpath%28board%5Bi%5D%5Bj%5D%29%20%20%20%22.svg?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=2b0a14833a97eed21c82c9321cfdc19acd3b393b;hb=188b4a8f2e3edfa86c4e9169ddac9a14ebc12689;hp=8d8b311aec49988cbda7837515c5c1ae84255536;hpb=e33e50fa2122c1df2aa9d4d15a2f9d75341b0d70;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 8d8b311a..2b0a1483 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -706,7 +706,7 @@ export default { } }, newChallenge: async function() { - if (this.newchallenge.cadence.match(/^[0-9]+$/)) + if (!!(this.newchallenge.cadence.match(/^[0-9]+$/))) this.newchallenge.cadence += "+0"; //assume minutes, no increment const ctype = this.classifyObject(this.newchallenge); // TODO: cadence still unchecked so ctype could be wrong... @@ -812,6 +812,8 @@ export default { const oppsid = this.getOppsid(c); if (oppsid) this.send("refusechallenge", { data: c.id, target: oppsid }); + if (c.type == "corr") + ajax("/challenges", "DELETE", { id: c.id }); } this.send("deletechallenge", { data: c.id }); }, @@ -850,9 +852,8 @@ export default { } else { // My challenge - if (c.type == "corr") { + if (c.type == "corr") ajax("/challenges", "DELETE", { id: c.id }); - } this.send("deletechallenge", { data: c.id }); } // In all cases, the challenge is consumed: