Attempt for better connection indicators
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 22 Mar 2020 13:55:04 +0000 (14:55 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 22 Mar 2020 13:55:04 +0000 (14:55 +0100)
TODO
client/src/views/Game.vue
client/src/views/Hall.vue

diff --git a/TODO b/TODO
index 22527be..819ebc8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,7 @@
 # New variants
 Landing pieces from empty board:
 https://www.chessvariants.com/diffsetup.dir/unachess.html
+Parachute v1 & 2
 
 Generator variant, called "Matrix" ?
 Peces on first rank never move but generate new pieces. Pawn don't generate.
index d4a7b6f..0662fe8 100644 (file)
@@ -460,6 +460,9 @@ export default {
             this.people[data.from] = { focus: true };
             this.newConnect[data.from] = true; //for self multi-connects tests
             this.send("askidentity", { target: data.from });
+          } else if (!this.people[data.from].focus) {
+            this.people[data.from].focus = true;
+            this.$forceUpdate(); //TODO: shouldn't be required
           }
           break;
         case "disconnect":
index f401c6e..d113da7 100644 (file)
@@ -613,8 +613,11 @@ export default {
             this.people[data.from] = { pages: [{ path: page, focus: true }] };
           else {
             // Append page if not already in list
-            if (!(this.people[data.from].pages.find(p => p.path == page)))
+            let ppage = this.people[data.from].pages.find(p => p.path == page);
+            if (!ppage)
               this.people[data.from].pages.push({ path: page, focus: true });
+            else ppage.focus = true;
+            this.$forceUpdate(); //TODO: shouldn't be required
           }
           if (!this.people[data.from].name && this.people[data.from].id !== 0) {
             // Identity not known yet
@@ -633,6 +636,7 @@ export default {
           ArrayFun.remove(this.people[data.from].pages, p => p.path == page);
           if (this.people[data.from].pages.length == 0)
             this.$delete(this.people, data.from);
+          else this.$forceUpdate(); //TODO: shouldn't be required
           // Disconnect means no more tmpIds:
           if (data.code == "disconnect") {
             // Remove the live challenges sent by this player: