X-Git-Url: https://git.auder.net/variants/%24%7Bvname%7D/current/git-logo.png?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=89edb96d25bded7121909d3c46f766bd7fc72cef;hb=68e3aa8c7a92efe3461bfc5c904f9763bca5d2da;hp=f12290d7b6f8b22c22505b93be06fee64300ac2d;hpb=6d96353679db2c1e10a380524b6c60c363d81216;p=vchess.git diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index f12290d7..89edb96d 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -236,7 +236,10 @@ export default { clearInterval(this.retrySendmove); if (!!this.clockUpdate) clearInterval(this.clockUpdate); + this.conn.removeEventListener("message", this.socketMessageListener); + this.conn.removeEventListener("close", this.socketCloseListener); this.send("disconnect"); + this.conn = null; }, visibilityChange: function() { // TODO: Use document.hidden? https://webplatform.news/issues/2019-03-27 @@ -458,9 +461,11 @@ export default { case "connect": if (!this.people[data.from]) { this.people[data.from] = { focus: true }; - this.$forceUpdate(); //TODO: shouldn't be required this.newConnect[data.from] = true; //for self multi-connects tests this.send("askidentity", { target: data.from }); + } else if (!this.people[data.from].focus) { + this.people[data.from].focus = true; + this.$forceUpdate(); //TODO: shouldn't be required } break; case "disconnect":