Patch to Hall to observe opponents through 'social' modal although game is not in...
authorBenjamin Auder <benjamin.auder@somewhere>
Tue, 18 Feb 2020 19:33:28 +0000 (20:33 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Tue, 18 Feb 2020 19:33:28 +0000 (20:33 +0100)
client/src/views/Hall.vue

index b4869c9..1b8681f 100644 (file)
@@ -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) {