From 43d9d974574cd3ea2fe21c07fa33a6b2233e6abf Mon Sep 17 00:00:00 2001 From: tonlls Date: Mon, 22 Apr 2024 16:03:56 +0200 Subject: [PATCH] fixed game start --- chain-reaction/src/app/game/game.component.ts | 6 +++--- chain-reaction/src/app/lobby/lobby.component.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chain-reaction/src/app/game/game.component.ts b/chain-reaction/src/app/game/game.component.ts index dc9a399..6bec3c4 100644 --- a/chain-reaction/src/app/game/game.component.ts +++ b/chain-reaction/src/app/game/game.component.ts @@ -26,9 +26,9 @@ export class GameComponent { this.partyCode = state.partyCode; } this.refreshGame(); - // setInterval(() => { - // this.refreshGame(); - // }, 5000); + setInterval(() => { + this.refreshGame(); + }, 5000); } refreshGame() { diff --git a/chain-reaction/src/app/lobby/lobby.component.ts b/chain-reaction/src/app/lobby/lobby.component.ts index eb84bca..3975c2e 100644 --- a/chain-reaction/src/app/lobby/lobby.component.ts +++ b/chain-reaction/src/app/lobby/lobby.component.ts @@ -64,6 +64,9 @@ export class LobbyComponent implements OnInit { this.sessionService.refreshParty(this.playerId).subscribe({ next: (response) => { this.players = response.users; + if(response.target){ + this.router.navigate(['/game']); + } this.ref.detectChanges(); }, error: (error) => {