Better challenge link in emails, better text on 'social' button
[vchess.git] / client / src / views / Hall.vue
index b4869c9..68d3b48 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) }}
@@ -83,7 +83,7 @@ main
     .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
       .button-group
         button#peopleBtn(onClick="window.doClick('modalPeople')")
-          | {{ st.tr["Social"] }}
+          | {{ st.tr["Who's there?"] }}
         button(onClick="window.doClick('modalNewgame')")
           | {{ st.tr["New game"] }}
   .row
@@ -275,8 +275,11 @@ export default {
         this.newchallenge.cadence = b.innerHTML;
       });
     });
-    const showCtype = localStorage.getItem("type-challenges") || "live";
-    const showGtype = localStorage.getItem("type-games") || "live";
+    const dispCorr = this.$route.query["disp"];
+    const showCtype =
+      dispCorr || localStorage.getItem("type-challenges") || "live";
+    const showGtype =
+      dispCorr || localStorage.getItem("type-games") || "live";
     this.setDisplay("c", showCtype);
     this.setDisplay("g", showGtype);
   },
@@ -342,7 +345,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) {