Skip to content

Commit dffecde

Browse files
committed
consider autoStart in restart function
1 parent a6986b2 commit dffecde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/useTimer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default function useTimer({ expiryTimestamp: expiry, onExpire, autoStart
3333
}
3434

3535
function restart(newExpiryTimestamp) {
36+
setIsRunning(autoStart);
3637
setExpiryTimestamp(newExpiryTimestamp);
3738
setSeconds(Time.getSecondsFromExpiry(newExpiryTimestamp));
3839
}

0 commit comments

Comments
 (0)