Fix trans-pages events askidentity and askgame
[vchess.git] / client / src / views / Hall.vue
index 16af9c9..ae04b7d 100644 (file)
@@ -4,7 +4,6 @@ main
   div#infoDiv(role="dialog" data-checkbox="modalInfo")
     .card.text-center
       label.modal-close(for="modalInfo")
-      h3.section
       p(v-html="infoMessage")
   input#modalNewgame.modal(type="checkbox")
   div#newgameDiv(role="dialog" data-checkbox="modalNewgame")
@@ -303,7 +302,7 @@ export default {
             if (s.sid != this.st.user.sid && !identityAsked[s.sid])
             {
               identityAsked[s.sid] = true;
-              this.send("askidentity", {target:s.sid});
+              this.send("askidentity", {target:s.sid, page:s.page || "/"});
             }
             if (!this.people[s.sid])
               this.$set(this.people, s.sid, {id:0, name:"", pages:[s.page || "/"]});
@@ -312,7 +311,7 @@ export default {
             if (!s.page) //peer is in Hall
               this.send("askchallenge", {target:s.sid});
             else //peer is in Game
-              this.send("askgame", {target:s.sid});
+              this.send("askgame", {target:s.sid, page:s.page});
           });
           break;
         }
@@ -327,7 +326,7 @@ export default {
             if (data.code == "connect")
               this.send("askchallenge", {target:data.from});
             else
-              this.send("askgame", {target:data.from});
+              this.send("askgame", {target:data.from, page:data.page});
           }
           else
           {
@@ -338,7 +337,7 @@ export default {
           if (this.people[data.from].id == 0)
           {
             this.newConnect[data.from] = true; //for self multi-connects tests
-            this.send("askidentity", {target:data.from});
+            this.send("askidentity", {target:data.from, page:data.page || "/"});
           }
           break;
         case "disconnect":
@@ -512,7 +511,6 @@ export default {
               "#/game/" + gameInfo.id + "</a>";
             let modalBox = document.getElementById("modalInfo");
             modalBox.checked = true;
-            setTimeout(() => { modalBox.checked = false; }, 3000);
           }
           break;
         }
@@ -716,7 +714,8 @@ export default {
   margin: 10px auto 5px auto
 
 #infoDiv > .card
-  max-width: 370px
+  padding: 15px 0
+  max-width: 430px
 
 #newgameDiv > .card
   max-width: 767px