Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit 3c70e14

Browse files
committed
fix: move duration computation into closure
1 parent 0bfa927 commit 3c70e14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/client/src/routes/Main/Home/Countdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export default function Countdown({
3333
useEffect(() => {
3434
if (!nextPeriod) return;
3535

36-
const duration = DateTime.fromISO(nextPeriod.startTime).diffNow();
37-
3836
const timer = setInterval(() => {
37+
const duration = DateTime.fromISO(nextPeriod.startTime).diffNow();
38+
3939
setCountdown(
4040
duration.milliseconds > 0 ? duration.toFormat("hh:mm:ss") : "Now"
4141
);

0 commit comments

Comments
 (0)