State reset after rounds
This commit is contained in:
parent
f9447b3deb
commit
09fb1e3938
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user