fix currentPlayer and lastPlayer values when playerName is changed
authorLaurent Mazet <mazet@softndesign.org>
Sat, 9 Aug 2025 15:23:53 +0000 (17:23 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sat, 9 Aug 2025 15:23:53 +0000 (17:23 +0200)
public/trivabble.js

index 5f53c79588973625209522d2da4a3aced90239f5..22399cc4b9f8139e07a51c0c273d95b7ac48d214 100644 (file)
                 } else {
                     blink(playerNameCell);
                 }
+                if (currentPlayer === playerName) {
+                    currentPlayer = newName;
+                }
+                if (lastPlayer === playerName) {
+                    lastPlayer = newName;
+                }
                 chatMessage("", format(_("{0} changed their name to {1}"), playerName, newName));
             }
         }