mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
fix check-for-updates
This commit is contained in:
parent
f975373a34
commit
7420044f2f
@ -66,7 +66,7 @@ export class Updater {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the app update status and sends it to the main window
|
* Sets the app update status and sends it to the main window
|
||||||
* @param value The AppUpdateStatus to set, either "ready" or "unavailable"
|
* @param value The status to set
|
||||||
*/
|
*/
|
||||||
private set status(value: UpdaterStatus) {
|
private set status(value: UpdaterStatus) {
|
||||||
this._status = value;
|
this._status = value;
|
||||||
@ -105,17 +105,15 @@ export class Updater {
|
|||||||
!this.lastUpdateCheck ||
|
!this.lastUpdateCheck ||
|
||||||
Math.abs(now.getTime() - this.lastUpdateCheck.getTime()) > autoUpdateOpts.intervalms
|
Math.abs(now.getTime() - this.lastUpdateCheck.getTime()) > autoUpdateOpts.intervalms
|
||||||
) {
|
) {
|
||||||
fireAndForget(() =>
|
const result = await autoUpdater.checkForUpdates();
|
||||||
autoUpdater.checkForUpdates().then(() => {
|
console.log("check for updates result:", result.updateInfo.version, result);
|
||||||
if (userInput && this.status === "up-to-date") {
|
if (userInput && !result.downloadPromise) {
|
||||||
const dialogOpts: Electron.MessageBoxOptions = {
|
const dialogOpts: Electron.MessageBoxOptions = {
|
||||||
type: "info",
|
type: "info",
|
||||||
message: "There are currently no updates available.",
|
message: "There are currently no updates available.",
|
||||||
};
|
};
|
||||||
electron.dialog.showMessageBox(electron.BrowserWindow.getFocusedWindow(), dialogOpts);
|
electron.dialog.showMessageBox(electron.BrowserWindow.getFocusedWindow(), dialogOpts);
|
||||||
}
|
}
|
||||||
})
|
|
||||||
);
|
|
||||||
this.lastUpdateCheck = now;
|
this.lastUpdateCheck = now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user