summaryrefslogtreecommitdiff
path: root/scripts/gui/lobby.js
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-08-23 23:25:33 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-08-23 23:25:33 -0400
commite5ecd03e04afa3fdbdd1dfa275a2fd0368183545 (patch)
treebbda2ca5d6c9abe594867f4283496fb7ddd90998 /scripts/gui/lobby.js
parent43333e401a22fc19a7cf0c87c180b37989a7b1a5 (diff)
Remove deleted games from ui
Diffstat (limited to 'scripts/gui/lobby.js')
-rw-r--r--scripts/gui/lobby.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/gui/lobby.js b/scripts/gui/lobby.js
index f790a31..3a1689b 100644
--- a/scripts/gui/lobby.js
+++ b/scripts/gui/lobby.js
@@ -206,7 +206,13 @@ class Lobby {
// Called when a new public game is removed on the server
// { data string } the uuid of the game to delete
deleteGame (data) {
+ if(this.games[data] == null)
+ return;
+
+ this.games[data].remove();
delete this.games[data];
+ this.gameCt--;
+ this.e.stats.pubgame.innerText = this.gameCt;
}
// Called when the client wants to toggle the new game screen