diff --git a/src/components/Stats/Timer/Timer.tsx b/src/components/Stats/Timer/Timer.tsx index 5462b67..ef7f6bd 100644 --- a/src/components/Stats/Timer/Timer.tsx +++ b/src/components/Stats/Timer/Timer.tsx @@ -62,7 +62,10 @@ const Timer = () => { })); clearInterval(intervalId); - saveToLocalStorage(displayedTime); + + if (gameState.endType === 'win') { + saveToLocalStorage(displayedTime); + } } }, [intervalId, gameState.endType, setGameState, displayedTime]);