diff --git a/src/App.jsx b/src/App.jsx index a6ada8f..83638d6 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -191,9 +191,10 @@ export default function App() { // Only start timer on first damage if (!scoreTimerRef.current) { scoreEndRef.current = Date.now() + 20000; + let lastLeft = -1; const tick = () => { const left = Math.max(0, Math.ceil((scoreEndRef.current - Date.now()) / 1000)); - setScoreTimeLeft(left); + if (left !== lastLeft) { lastLeft = left; setScoreTimeLeft(left); } if (left > 0) scoreRafRef.current = requestAnimationFrame(tick); }; tick();