From c370203807f49ae4b6148633bcb83792f1574350 Mon Sep 17 00:00:00 2001 From: Ben Stein Date: Thu, 12 Oct 2023 14:50:39 -0400 Subject: [PATCH] Correct local storage key names for external game deploy. --- .../app/game/pages/game-page/game-page.component.ts | 12 ++++++++---- .../src/app/services/external-game.service.ts | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/projects/gameboard-ui/src/app/game/pages/game-page/game-page.component.ts b/projects/gameboard-ui/src/app/game/pages/game-page/game-page.component.ts index 76cdc9ef..ef773ca7 100644 --- a/projects/gameboard-ui/src/app/game/pages/game-page/game-page.component.ts +++ b/projects/gameboard-ui/src/app/game/pages/game-page/game-page.component.ts @@ -24,6 +24,7 @@ import { RouterService } from '@/services/router.service'; import { AppTitleService } from '@/services/app-title.service'; import { UserService } from '@/api/user.service'; import { ConfigService } from '@/utility/config.service'; +import { UnsubscriberService } from '@/services/unsubscriber.service'; interface GameEnrollmentContext { game: Game; @@ -69,6 +70,7 @@ export class GamePageComponent implements OnDestroy { private modalService: ModalConfirmService, private routerService: RouterService, private titleService: AppTitleService, + private unsub: UnsubscriberService, private windowService: WindowService ) { const user$ = localUser.user$.pipe(map(u => !!u ? u : {} as ApiUser)); @@ -236,10 +238,12 @@ export class GamePageComponent implements OnDestroy { if (ctx.game.requireSynchronizedStart) { await this.handleLiveSyncStartSessionJoined(ctx); - this.externalGameDeployStartSubscription = this.gameHubService.externalGameLaunchStarted$.subscribe(startState => { - if (startState) - this.handleLiveSyncStartSessionJoined(ctx); - }); + this.unsub.add( + this.gameHubService.externalGameLaunchStarted$.subscribe(startState => { + if (startState) + this.handleLiveSyncStartSessionJoined(ctx); + }) + ); } } else { diff --git a/projects/gameboard-ui/src/app/services/external-game.service.ts b/projects/gameboard-ui/src/app/services/external-game.service.ts index 58faeac3..2f416193 100644 --- a/projects/gameboard-ui/src/app/services/external-game.service.ts +++ b/projects/gameboard-ui/src/app/services/external-game.service.ts @@ -35,8 +35,8 @@ export class ExternalGameService { const namespaceKeyName = this.computeNamespaceKey(game.teamId); this.storage.addArbitrary(namespaceKeyName, JSON.stringify({ - [`oidcLink`]: oidcLink, - [`gameServerUrl`]: game.gameServerUrl, + [`${namespaceKeyName}:oidcLink`]: oidcLink, + [`${namespaceKeyName}:gameServerUrl`]: game.gameServerUrl, })); }