Skip to content

Commit 978a770

Browse files
jaxoncreedCopilot
andauthored
Update chats/ldo/src/util/scheduleNewDayTrigger.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9ea964a commit 978a770

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

chats/ldo/src/util/scheduleNewDayTrigger.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ export function scheduleNewDayTrigger(onNewDay: () => void): () => void {
1616

1717
const msUntilNextMidnight = nextUtcMidnight.getTime() - now.getTime();
1818

19-
timer = setTimeout(() => {
19+
timeoutId = setTimeout(() => {
2020
onNewDay();
21-
timer = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
21+
intervalId = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
2222
}, msUntilNextMidnight);
2323

2424
return () => {
25-
clearTimeout(timer);
26-
clearInterval(timer); // works even if it's not an interval yet
25+
clearTimeout(timeoutId);
26+
clearInterval(intervalId);
2727
};
2828
}

0 commit comments

Comments
 (0)