refactor: fix missed first update (#1031)

This commit is contained in:
Carlos Valente
2024-06-03 20:27:51 +02:00
committed by GitHub
parent 73e4a15718
commit c2039866b4
5 changed files with 86 additions and 43 deletions
@@ -26,8 +26,7 @@ export function getShouldTimerUpdate(previousValue: number, currentValue: MaybeN
return false;
}
// we avoid trigger ahead since it can cause duplicate triggers
// we force the timer value to be negative because we need a ceiling reduction
const shouldUpdateTimer = millisToSeconds(-currentValue) !== millisToSeconds(-previousValue);
const shouldUpdateTimer = millisToSeconds(currentValue) !== millisToSeconds(previousValue);
return shouldUpdateTimer;
}