()
| 200 | export const onCooldownExpired = cooldownExpired.subscribe |
| 201 | |
| 202 | export function getFastModeRuntimeState(): FastModeRuntimeState { |
| 203 | if ( |
| 204 | runtimeState.status === 'cooldown' && |
| 205 | Date.now() >= runtimeState.resetAt |
| 206 | ) { |
| 207 | if (isFastModeEnabled() && !hasLoggedCooldownExpiry) { |
| 208 | logForDebugging('Fast mode cooldown expired, re-enabling fast mode') |
| 209 | hasLoggedCooldownExpiry = true |
| 210 | cooldownExpired.emit() |
| 211 | } |
| 212 | runtimeState = { status: 'active' } |
| 213 | } |
| 214 | return runtimeState |
| 215 | } |
| 216 | |
| 217 | export function triggerFastModeCooldown( |
| 218 | resetTimestamp: number, |
no test coverage detected