fix(multi): stay on game screen between rounds instead of redirecting to lobby

This commit is contained in:
jessy-david-dev
2026-04-11 22:19:25 +02:00
parent 1aad4d74a9
commit b76fbf8789
2 changed files with 20 additions and 2 deletions
+18
View File
@@ -114,6 +114,24 @@ export function GameScreen({
</div> </div>
); );
// Entre les manches : attente que l'hôte démarre la suivante
if (room.phase === "waiting") return (
<div className="min-h-dvh w-full bg-[#0f0f0f] text-[#f0f0f0] flex items-center justify-center px-4">
<div className="text-center flex flex-col items-center gap-4">
<div className="text-2xl font-black">Manche {room.round}/{room.totalRounds} terminée</div>
<p className="text-sm text-[#888] animate-pulse-slow">
{isHost ? "Lance la manche suivante quand tu veux." : "En attente que l'hôte démarre la prochaine manche..."}
</p>
{isHost && (
<div className="flex flex-col gap-2.5 w-full max-w-xs mt-2">
<button className={btnPrimary} onClick={onNextRound}>Manche suivante</button>
<button className={btnGhost} onClick={onResetGame}>Arrêter la partie</button>
</div>
)}
</div>
</div>
);
// Countdown // Countdown
if (room.phase === "countdown") return ( if (room.phase === "countdown") return (
<div className="min-h-dvh w-full bg-[#0f0f0f] text-[#f0f0f0] flex items-center justify-center px-4"> <div className="min-h-dvh w-full bg-[#0f0f0f] text-[#f0f0f0] flex items-center justify-center px-4">
+2 -2
View File
@@ -50,12 +50,12 @@ export function useGameHandlers({
async function handleNextRound() { async function handleNextRound() {
await multi.nextRound(); await multi.nextRound();
setScreen("lobby"); // On reste sur "game" — le GameScreen affiche le lobby quand phase === "waiting"
} }
async function handleResetGame() { async function handleResetGame() {
await multi.resetGame(); await multi.resetGame();
setScreen("lobby"); // On reste sur "game" — le GameScreen affiche le lobby quand phase === "waiting"
} }
function handleLeave() { function handleLeave() {