Closed nperichSYKES closed 4 years ago
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.
Thanks for the issues, this is fixed now in v1.1.8
It seems this hook sets the initial time then counts down by second.
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.