From a2bd587aebc0104db71f9404aadeec72c9141102 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sun, 22 Mar 2020 14:55:04 +0100
Subject: [PATCH] Attempt for better connection indicators

---
 TODO                      | 1 +
 client/src/views/Game.vue | 3 +++
 client/src/views/Hall.vue | 6 +++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index 22527be5..819ebc87 100644
--- 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.
diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index d4a7b6f2..0662fe84 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -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":
diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue
index f401c6ef..d113da7a 100644
--- a/client/src/views/Hall.vue
+++ b/client/src/views/Hall.vue
@@ -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:
-- 
2.44.0