diff --git a/client/src/components/Podium/Podium.tsx b/client/src/components/Podium/Podium.tsx index 87c35ff..0122d09 100644 --- a/client/src/components/Podium/Podium.tsx +++ b/client/src/components/Podium/Podium.tsx @@ -12,22 +12,21 @@ export interface PodiumProps { className?: string } +const victoryMusicUrl = + 'https://statics.blob.core.windows.net/public/victory.mp3' + const Podium: FC = ({ players, currentPlayerId, className }) => { const classes = classnames(className, 'Podium') const isWinner = players[0].id === currentPlayerId useEffect(() => { - if (isWinner) - new Audio( - 'https://statics.blob.core.windows.net/public/victory.mp3' - ).play() + if (isWinner) new Audio(victoryMusicUrl).play() }, [currentPlayerId, isWinner]) const { width, height } = useWindowSize() return (
- {isWinner && }

Podium

    {players.map((player, index) => ( @@ -39,7 +38,10 @@ const Podium: FC = ({ players, currentPlayerId, className }) => { ))}
{isWinner ? ( - Vous avez gagné ! + <> + + Vous avez gagné ! + ) : ( 'La partie est terminée' )} diff --git a/client/src/pages/Game.tsx b/client/src/pages/Game.tsx index 4e97f28..59e0645 100644 --- a/client/src/pages/Game.tsx +++ b/client/src/pages/Game.tsx @@ -73,6 +73,9 @@ const Game: FC = (props: GameProps) => { return } + if (!currentPlayerId && game.status === GameStatus.ROUND_IN_PROGRESS) + return

La partie est en cours, vous ne pouvez la rejoindre.

+ if (currentPlayerId && game.players.length && hubConnection) { // The oldest member of the lobby is the host const isGameHost = game.players[0].id === currentPlayerId @@ -106,7 +109,7 @@ const Game: FC = (props: GameProps) => { } } } - return <>La partie est en cours. + return null } export default Game