diff --git a/client/src/pages/Game/Game.jsx b/client/src/pages/Game/Game.jsx index 0e24875..5418721 100644 --- a/client/src/pages/Game/Game.jsx +++ b/client/src/pages/Game/Game.jsx @@ -72,6 +72,9 @@ export const Game = () => { setRound(data.round); setPhase("composing"); setTimeLeft(data.timeRemaining); + setSelectedSong(null); + setHasGuessed(false); + setGuessResult(null); }, "guessing-phase-started": (data) => { console.log("Guessing phase started:", data); @@ -229,6 +232,14 @@ export const Game = () => { } }, [allSongs, songOptions]); + useEffect(() => { + if (phase === 'composing') { + setSelectedSong(null); + setHasGuessed(false); + setGuessResult(null); + } + }, [phase]); + const handleFrequencyChange = useCallback((newFrequency, isPlaying) => { setFrequency(newFrequency); setComposerIsPlaying(isPlaying);