From eadd999bcb51556cbca5eadacee560abc361d1eb Mon Sep 17 00:00:00 2001 From: Andrio Celos Date: Fri, 24 Nov 2023 14:04:35 +1100 Subject: [PATCH] Hide the upcoming cards option in the lobby page if there are none --- TableturfBattleClient/src/app.ts | 6 ++++-- TableturfBattleClient/tableturf.css | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TableturfBattleClient/src/app.ts b/TableturfBattleClient/src/app.ts index cb3bdef..11c266e 100644 --- a/TableturfBattleClient/src/app.ts +++ b/TableturfBattleClient/src/app.ts @@ -49,8 +49,10 @@ function onInitialise(callback: () => void) { function initCardDatabase(cards: Card[]) { deckEditInitCardDatabase(cards); - if (!cards.find(c => c.number < 0)) + if (!cards.find(c => c.number < 0)) { gameSetupAllowUpcomingCardsBox.parentElement!.hidden = true; + lobbyAllowUpcomingCardsBox.parentElement!.hidden = true; + } } function initStageDatabase(stages: Stage[]) { preGameInitStageDatabase(stages); @@ -260,7 +262,7 @@ function setupWebSocket(gameID: string) { enterGameTimeout = null; } setLoadingMessage(null); - if (!e.data) { + if (!payload.data) { webSocket.close(); alert('The game was not found.'); } else { diff --git a/TableturfBattleClient/tableturf.css b/TableturfBattleClient/tableturf.css index feb761f..c2ca1fe 100644 --- a/TableturfBattleClient/tableturf.css +++ b/TableturfBattleClient/tableturf.css @@ -249,7 +249,7 @@ footer { margin-right: 1.5em; } -#lobbyPage label { +#lobbyPage label:not([hidden]) { display: block; }