(reducedSeconds)
| 48 | |
| 49 | // Calculate how many ms should pass until next update depending on if seconds is displayed or not |
| 50 | const delayCalculator = (reducedSeconds) => { |
| 51 | const EXTRA_DELAY = 50; // Deliberate imperceptible delay to prevent off-by-one timekeeping errors |
| 52 | |
| 53 | if (this.config.displaySeconds) { |
| 54 | return 1000 - moment().milliseconds() + EXTRA_DELAY; |
| 55 | } else { |
| 56 | return (60 - reducedSeconds) * 1000 - moment().milliseconds() + EXTRA_DELAY; |
| 57 | } |
| 58 | }; |
| 59 | |
| 60 | // A recursive timeout function instead of interval to avoid drifting |
| 61 | const notificationTimer = () => { |
no outgoing calls
no test coverage detected