Closed
Description
It seems this hook sets the initial time then counts down by second.
if(isValidExpiryTimestamp(expiryTimestamp) && !intervalRef.current) {
calculateExpiryDate();
intervalRef.current = setInterval(() => subtractSecond(), 1000);
}
But if the phone is asleep of course it can't count down. This means that when it wakes up, the count is behind. The fix could be something like subtracting from the end on each interval rather than depending on the current state.
Metadata
Metadata
Assignees
Labels
No labels