We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0c2a35b + 978a770 commit cf2f814Copy full SHA for cf2f814
chats/ldo/src/util/scheduleNewDayTrigger.ts
@@ -16,13 +16,13 @@ export function scheduleNewDayTrigger(onNewDay: () => void): () => void {
16
17
const msUntilNextMidnight = nextUtcMidnight.getTime() - now.getTime();
18
19
- timer = setTimeout(() => {
+ timeoutId = setTimeout(() => {
20
onNewDay();
21
- timer = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
+ intervalId = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
22
}, msUntilNextMidnight);
23
24
return () => {
25
- clearTimeout(timer);
26
- clearInterval(timer); // works even if it's not an interval yet
+ clearTimeout(timeoutId);
+ clearInterval(intervalId);
27
};
28
}
0 commit comments