X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=0467dab97e006dc6272d86b670c5a57143da74e0;hb=2be5d6140901fc7bb2a33d672e52cfdc545a1912;hp=4c80803aea4269171b71cb068a312d95d7c62acf;hpb=b4de2e730539cadbff94a42eccfb9cb046cbf810;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 4c80803a..0467dab9 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -509,15 +509,17 @@ export default { cid: c.id, target: c.from.sid})); } } - else - localStorage.removeItem("challenge"); - if (c.type == "corr") + else //my challenge { - ajax( - "/challenges", - "DELETE", - {id: c.id} - ); + localStorage.removeItem("challenge"); + if (c.type == "corr") + { + ajax( + "/challenges", + "DELETE", + {id: c.id} + ); + } } }, // NOTE: when launching game, the challenge is already deleted @@ -542,9 +544,9 @@ export default { ajax( "/games", "POST", - {gameInfo: gameInfo} + {gameInfo: gameInfo, cid: c.id}, //cid useful to delete challenge + response => { this.$router.push("/game/" + response.gameId); } ); - // TODO: redirection here } }, // NOTE: for live games only (corr games start on the server)