Skip to content
Snippets Groups Projects
Commit 6554c7e9 authored by narindra.rajohnso's avatar narindra.rajohnso
Browse files

app fonctionnal but certain bug like the list of players persist

parent 86488c1b
No related branches found
No related tags found
No related merge requests found
......@@ -44,5 +44,15 @@
</tbody>
</table>
</div>
<div class="flex justify-center">
<button (click)="restartGame()"
class="relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden text-sm font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-teal-300 to-lime-300 group-hover:from-teal-300 group-hover:to-lime-300 dark:text-white dark:hover:text-gray-900 focus:ring-4 focus:outline-none focus:ring-lime-200 dark:focus:ring-lime-800">
<span
class="relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0">
Rejouer
</span>
</button>
</div>
</div>
......@@ -26,6 +26,7 @@ export class QuizzPlayComponent implements OnInit, OnDestroy {
this.loadingQuestion = true;
this.loadingPlayers = true;
this.quizzService.onPlayerReady();
this.quizzService.onPlayerNotReady();
this.quizzService.onGameFinished();
this.quizzService.socket.emit("player-ready");
this.quizzService.socket.emit("on-game");
......@@ -45,6 +46,13 @@ export class QuizzPlayComponent implements OnInit, OnDestroy {
this.quizzService.socket.emit("validate-question", this.selectedResponseIndex);
}
restartGame(){
this.quizzService.gameFinished=false;
this.quizzService.socket.emit("player-not-ready");
this.quizzService.socket.emit("restart-game");
this.router.navigate([`/${this.quizzService.username}/play/waiting-players`]);
}
ngOnDestroy() {
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment