From e5ecd03e04afa3fdbdd1dfa275a2fd0368183545 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 23 Aug 2022 23:25:33 -0400 Subject: Remove deleted games from ui --- scripts/gui/lobby.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3