MCPcopy
hub / github.com/wavetermdev/waveterm / promptToInstallUpdate

Method promptToInstallUpdate

emain/updater.ts:181–198  ·  view source on GitHub ↗

* Prompts the user to install the downloaded application update and restarts the application

()

Source from the content-addressed store, hash-verified

179 * Prompts the user to install the downloaded application update and restarts the application
180 */
181 async promptToInstallUpdate() {
182 const dialogOpts: Electron.MessageBoxOptions = {
183 type: "info",
184 buttons: ["Restart", "Later"],
185 title: "Application Update",
186 message: process.platform === "win32" ? this.availableUpdateReleaseNotes : this.availableUpdateReleaseName,
187 detail: "A new version has been downloaded. Restart the application to apply the updates.",
188 };
189
190 const allWindows = getAllWaveWindows();
191 if (allWindows.length > 0) {
192 await dialog.showMessageBox(focusedWaveWindow ?? allWindows[0], dialogOpts).then(({ response }) => {
193 if (response === 0) {
194 fireAndForget(this.installUpdate.bind(this));
195 }
196 });
197 }
198 }
199
200 /**
201 * Restarts the app and installs an update if it is available.

Callers

nothing calls this directly

Calls 2

getAllWaveWindowsFunction · 0.90
fireAndForgetFunction · 0.90

Tested by

no test coverage detected