aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/Timer/Timer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/Timer/Timer.js b/src/components/Timer/Timer.js
index 6fee1b1..99356a5 100644
--- a/src/components/Timer/Timer.js
+++ b/src/components/Timer/Timer.js
@@ -22,6 +22,7 @@ const Timer = ({ registerResult }) => {
const [repeater, setRepeater] = useState(0);
useEffect(()=> {
+ clearInterval(repeater);
const timestamp = Date.now();
if (mode === 'countdown') setRepeater(setInterval(() => {
@@ -36,7 +37,6 @@ const Timer = ({ registerResult }) => {
if (mode === 'over') {
setTime('00:00:00');
- clearInterval(repeater);
}
}, [mode]);