Fix scrolling to current move in MovesList
[vchess.git] / client / src / views / Hall.vue
index b4869c9..2236ce3 100644 (file)
@@ -67,7 +67,7 @@ main
           )
             span {{ people[sid].name }}
             button.player-action(
-              v-if="sid!=st.user.sid || isGamer(sid)"
+              v-if="isGamer(sid) || (st.user.id > 0 && sid!=st.user.sid)"
               @click="challOrWatch(sid)"
             )
               | {{ getActionLabel(sid) }}
@@ -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) {