🐛 Saving time score only on winning

This commit is contained in:
2024-02-18 18:06:40 +01:00
parent 1377c3a8fa
commit 272af85c74
+3
View File
@@ -62,8 +62,11 @@ const Timer = () => {
}));
clearInterval(intervalId);
if (gameState.endType === 'win') {
saveToLocalStorage(displayedTime);
}
}
}, [intervalId, gameState.endType, setGameState, displayedTime]);
return (