Skip to content

Commit

Permalink
Destroy multiplayer component after pressing play again
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Computas committed Oct 2, 2024
1 parent c9ab51d commit bab5128
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/game/game-result/game-result.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,14 @@ export class GameResultComponent implements OnInit, OnDestroy {
}

playAgain(): void {
this.gameStateService.restartGame();
this.drawingService.clearState();
if (this.ismultiplayer) {
this.multiplayerService.clearState();
this.router.navigateByUrl('/welcome').then(() => {
this.router.navigateByUrl('/playgame/multiplayer');
});
}

this.drawingService.clearState();
this.gameStateService.restartGame();
}

endGame(): void {
Expand Down

0 comments on commit bab5128

Please sign in to comment.