From 157afc8a65694a79b42d9c7dcd33faa2346437a0 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Tue, 28 Nov 2023 09:43:56 +0100 Subject: [PATCH] fix endgame --- .../src/Components/GraphContainer.tsx | 2 +- cryptide_project/src/Pages/EndGame.tsx | 69 ++++++++++--------- cryptide_project/src/Pages/Lobby.tsx | 2 +- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/cryptide_project/src/Components/GraphContainer.tsx b/cryptide_project/src/Components/GraphContainer.tsx index 10bc725..640a824 100644 --- a/cryptide_project/src/Components/GraphContainer.tsx +++ b/cryptide_project/src/Components/GraphContainer.tsx @@ -494,7 +494,7 @@ const MyGraphComponent: React.FC = ({onNodeClick, handleS setActualPlayerIndexData(-1) setLastIndex(-1) setPlayerTouched(-1) - setWinnerData(players[winnerIndex]) + setWinnerData(winner) setElapsedTime(0) first = true diff --git a/cryptide_project/src/Pages/EndGame.tsx b/cryptide_project/src/Pages/EndGame.tsx index 2e56dee..710f344 100644 --- a/cryptide_project/src/Pages/EndGame.tsx +++ b/cryptide_project/src/Pages/EndGame.tsx @@ -74,10 +74,12 @@ function EndGame() { losingPlayers = []; } const theme = useTheme(); + + console.log(winner) return (
- {!IsSolo && + {!IsSolo ? (
@@ -110,42 +112,45 @@ function EndGame() {
- } -
-
-

Vous avez gagné !

-

Le tueur était {person?.getName()}

-
-
-
- -

{winner?.pseudo}

-
- -
-
- + ): ( +
+
+
+

Vous avez gagné !

+

Le tueur était {person?.getName()}

+
+
+
+ +

{winner?.pseudo}

-
-
- {!IsDaily &&

Nombre de coups : {nbCoup}

} -

Temps : {temps}s

+ +
+
+
-
- {indices.map((indice, index) => ( - //
-
-
Indice {index+1} : {indice.ToString("fr")}
-
- //
- )) - } +
+
+ {!IsDaily &&

Nombre de coups : {nbCoup}

} +

Temps : {temps}s

+
+
+ {indices.map((indice, index) => ( + //
+
+
Indice {index+1} : {indice.ToString("fr")}
+
+ //
+ )) + } +
+
+
+
-
-
-
+ )}
); } diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index 2ad4ce3..e0bc7a9 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -122,7 +122,7 @@ function Lobby() { gameStarted = true socket.off("player left") socket.off("new player") - navigate('/game?solo=false'); + navigate('/game?solo=false&daily=false'); }); socket.on("new player", (tab) =>{