From: Benjamin Auder Date: Tue, 18 Feb 2020 19:33:28 +0000 (+0100) Subject: Patch to Hall to observe opponents through 'social' modal although game is not in... X-Git-Url: https://git.auder.net/variants/Chakart/css/assets/doc/html/packages.html?a=commitdiff_plain;h=26f70eee84024ee170c6142e62fa08b1616ef6e3;p=vchess.git Patch to Hall to observe opponents through 'social' modal although game is not in the page --- diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index b4869c9c..1b8681fd 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -342,7 +342,9 @@ export default { if (matchGid) gids.push(matchGid[0]); }); const gid = gids[Math.floor(Math.random() * gids.length)]; - this.showGame(this.games.find(g => g.id == gid)); + const game = this.games.find(g => g.id == gid); + if (game) this.showGame(game); + else this.$router.push("/game/" + gid); //game vs. me } }, showGame: function(g) {