Skip to content

Commit cf2f814

Browse files
committed
Merge branch 'feat/chat-ldo' of github.com:solid-contrib/data-modules into feat/chat-ldo
2 parents 0c2a35b + 978a770 commit cf2f814

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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)