()
| 79 | } |
| 80 | |
| 81 | export const load = () => { |
| 82 | // Check for updates |
| 83 | if (!isDev && !process.env.OPENADE_SMOKE_TEST) { |
| 84 | checkForUpdatesAndNotify() |
| 85 | setInterval(checkForUpdatesAndNotify, 60000 * 30) // Check for updates every 30 minutes |
| 86 | } |
| 87 | |
| 88 | app.whenReady().then(() => { |
| 89 | // give them the notification again if they reload the app |
| 90 | app.on("web-contents-created", (_, contents) => { |
| 91 | contents.on("did-finish-load", () => { |
| 92 | if (pendingUpdate) { |
| 93 | setTimeout(() => { |
| 94 | notifyFeOnUpdateAvailable() |
| 95 | }, 5000) |
| 96 | } |
| 97 | }) |
| 98 | }) |
| 99 | |
| 100 | ipcMain.handle("retry-update-check", () => { |
| 101 | return checkForUpdatesAndNotify() |
| 102 | }) |
| 103 | |
| 104 | ipcMain.handle("apply-update", () => { |
| 105 | pendingUpdate = false |
| 106 | autoUpdater.quitAndInstall() |
| 107 | setTimeout(() => { |
| 108 | app.quit() |
| 109 | }, 90000) // There was no update force quit so pending update/issue potentially disappears |
| 110 | }) |
| 111 | }) |
| 112 | } |
nothing calls this directly
no test coverage detected