( delayMs: number = BACKGROUND_UPDATE_CHECK_DELAY_MS )
| 285 | } |
| 286 | |
| 287 | export function scheduleBackgroundAppUpdateCheck( |
| 288 | delayMs: number = BACKGROUND_UPDATE_CHECK_DELAY_MS |
| 289 | ): void { |
| 290 | initAppUpdater() |
| 291 | if (!updater || backgroundCheckScheduled) return |
| 292 | backgroundCheckScheduled = true |
| 293 | startupCheckTimer = setTimeout(() => { |
| 294 | startupCheckTimer = null |
| 295 | void checkForAppUpdates() |
| 296 | }, Math.max(0, delayMs)) |
| 297 | } |
| 298 | |
| 299 | export async function downloadAppUpdate(): Promise<AppUpdateState> { |
| 300 | if (!updater || updateState.phase !== 'available') return getAppUpdateState() |
no test coverage detected