fix: account for midnight rollover (#846)

This commit is contained in:
Carlos Valente
2024-03-22 08:04:23 +01:00
committed by GitHub
parent b06ab15190
commit 8c5aaa0901
+3 -1
View File
@@ -139,7 +139,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
// to apply custom logic for different datasets
// some of the data, we only update at intervals
const isTimeToUpdate = state.clock - TimerService.previousUpdate >= TimerService._updateInterval;
const isTimeToUpdate =
state.clock < TimerService.previousUpdate ||
state.clock - TimerService.previousUpdate >= TimerService._updateInterval;
// some changes need an immediate update
const hasNewLoaded = state.eventNow?.id !== TimerService.previousState?.eventNow?.id;