Skip to content

Commit 1995cfa

Browse files
committed
fix(useCountdown): Ensure "until" is in the future
1 parent 92811a4 commit 1995cfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/use-countdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function useCountdown(
4343
}
4444

4545
useEffect((): (() => void) | void => {
46-
if (timeLeft.current > 0) {
46+
if (Date.now() < usableConfig.until) {
4747
return timeSync.createCountdown((newTimeLeft): void => {
4848
timeLeft.current = newTimeLeft;
4949
forceUpdate();

0 commit comments

Comments
 (0)