From bb9fdf2b2be952a963fc095bfde07460a3a81da1 Mon Sep 17 00:00:00 2001 From: Ben Stein Date: Wed, 13 Dec 2023 15:23:23 -0500 Subject: [PATCH] Disable 'Ready' button when the client detects all players ready. --- .../session-start-controls.component.html | 4 ++-- .../session-start-controls.component.ts | 1 + .../gameboard-ui/src/app/services/notification.service.ts | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.html b/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.html index 04511d23..fd9a965f 100644 --- a/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.html +++ b/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.html @@ -35,9 +35,9 @@

Are you ready?

diff --git a/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.ts b/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.ts index a8636512..dfdeb591 100644 --- a/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.ts +++ b/projects/gameboard-ui/src/app/game/components/session-start-controls/session-start-controls.component.ts @@ -68,6 +68,7 @@ export class SessionStartControlsComponent implements OnInit { protected async handleReadyUpdated(player: Player) { this.isReadyingUp = true; + player.isReady = !player.isReady; this.logService.logInfo(`Player ${player.id} (user ${player.userId}) updating ready (${player.isReady})...`); await firstValueFrom(this.syncStartService.updatePlayerReadyState(player.id, { isReady: player.isReady })); this.logService.logInfo(`Player ${player.id} (user ${player.userId}) is now ${player.isReady ? "" : "NOT "}ready.`); diff --git a/projects/gameboard-ui/src/app/services/notification.service.ts b/projects/gameboard-ui/src/app/services/notification.service.ts index 453ea281..f10b668b 100644 --- a/projects/gameboard-ui/src/app/services/notification.service.ts +++ b/projects/gameboard-ui/src/app/services/notification.service.ts @@ -10,7 +10,6 @@ import { AuthService, AuthTokenState } from '../utility/auth.service'; import { UserService } from '../api/user.service'; import { HubPlayer, Player, TimeWindow } from '../api/player-models'; import { LogService } from './log.service'; -import { LocalStorageService } from './local-storage.service'; import { ExternalGameService } from './external-game.service'; @Injectable({ providedIn: 'root' })