(version: string)
| 918 | }; |
| 919 | |
| 920 | const promptInstallUpdate = async (version: string) => { |
| 921 | if (updateDialogOpen) return; |
| 922 | updateDialogOpen = true; |
| 923 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: dialog wrapper guarantees the open flag clears |
| 924 | try { |
| 925 | const response = await dialog.showMessageBox({ |
| 926 | type: "info", |
| 927 | title: "Update ready", |
| 928 | message: `Executor ${version} is ready to install.`, |
| 929 | detail: "Restart now to apply the update, or keep working — we'll prompt again later.", |
| 930 | buttons: ["Restart now", "Later"], |
| 931 | defaultId: 0, |
| 932 | cancelId: 1, |
| 933 | }); |
| 934 | if (response.response === 0) { |
| 935 | setUpdateStatus({ state: "installing", version }); |
| 936 | autoUpdater.quitAndInstall(false, true); |
| 937 | return; |
| 938 | } |
| 939 | declinedUpdateVersion = version; |
| 940 | } finally { |
| 941 | updateDialogOpen = false; |
| 942 | } |
| 943 | }; |
| 944 | |
| 945 | // Re-check periodically so a long-running session picks up releases |
| 946 | // without requiring a quit + relaunch. The boot-time check still runs; |
no test coverage detected