X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=ee8d53e5a54f59c06ff97aa6ac738d7515eee25e;hb=aef58d08d7c453f7ae7947e718c3bd6f092f02f2;hp=cb08808832af5d71b0159e601fd57aa589b9a3cf;hpb=0e0010227e46acb7774d134c9aa345eaa0c4404d;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index cb088088..ee8d53e5 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -681,12 +681,19 @@ export default { this.$delete(this.people, data.from[0]); else this.$forceUpdate(); //TODO: shouldn't be required if (data.code == "disconnect") { - // Remove the live challenges sent by this player: - ArrayFun.remove( - this.challenges, - c => c.type == "live" && c.from.sid == data.from[0], - "all" - ); + // Remove the live challenges sent by this player, if + // he isn't connected on another tab: + if ( + !this.people[data.from[0]] || + Object.values(this.people[data.from[0]].tmpIds) + .every(v => v.page != "/") + ) { + ArrayFun.remove( + this.challenges, + c => c.type == "live" && c.from.sid == data.from[0], + "all" + ); + } } else { // Remove the matching live game if now unreachable const gid = data.page.match(/[a-zA-Z0-9]+$/)[0];