(label: string, fn: () => Promise<unknown>)
| 93 | |
| 94 | const failedSteps = new Set<string>() |
| 95 | const runStep = async (label: string, fn: () => Promise<unknown>) => { |
| 96 | try { |
| 97 | await fn() |
| 98 | return true |
| 99 | } catch (e) { |
| 100 | console.error(`[startup] ${label} failed:`, e) |
| 101 | if (!failedSteps.has(label)) { |
| 102 | failedSteps.add(label) |
| 103 | Notification.warning({ |
| 104 | id: `startup_step_failed_${label.replace(/\s+/g, '_')}`, |
| 105 | title: t('warning'), |
| 106 | content: t('startup_task_failed', { step: label }), |
| 107 | }) |
| 108 | } |
| 109 | return false |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | hooks.retryStartupStorageSync = async () => { |
| 114 | hooks.startup.storageSyncing = true |
no test coverage detected