()
| 453 | |
| 454 | // Helper to notify update installed after restart |
| 455 | function notifyUpdateInstalled() { |
| 456 | if (configStore.get('update_installed')) { |
| 457 | try { |
| 458 | // Notify renderer |
| 459 | if (pgAdminMainScreen) { |
| 460 | misc.writeServerLog('[Auto-Updater]: Update installed successfully.'); |
| 461 | setTimeout(() => { |
| 462 | pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_installed: true}); |
| 463 | }, 10000); |
| 464 | } else { |
| 465 | // If main screen not ready, wait and send after it's created |
| 466 | app.once('browser-window-created', (_event, _window) => { |
| 467 | misc.writeServerLog('[Auto-Updater]: Update installed successfully.'); |
| 468 | setTimeout(() => { |
| 469 | pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_installed: true}); |
| 470 | }, 10000); |
| 471 | }); |
| 472 | } |
| 473 | // Reset the flag |
| 474 | configStore.set('update_installed', false); |
| 475 | } catch (err) { |
| 476 | misc.writeServerLog(`[Auto-Updater]: ${err}`); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | // setup preload events. |
| 482 | ipcMain.handle('showOpenDialog', (e, options) => dialog.showOpenDialog(BrowserWindow.fromWebContents(e.sender), options)); |
no test coverage detected