Skip to content

Commit 5488643

Browse files
committed
Revert wrong change made by github copilot
1 parent cf2f814 commit 5488643

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

chats/ldo/src/util/scheduleNewDayTrigger.ts

Lines changed: 5 additions & 5 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-
timeoutId = setTimeout(() => {
19+
timer = setTimeout(() => {
2020
onNewDay();
21-
intervalId = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
21+
timer = setInterval(onNewDay, 24 * 60 * 60 * 1000); // every 24 hours
2222
}, msUntilNextMidnight);
2323

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

0 commit comments

Comments
 (0)