fix(app): show download icon for shell updates (#3471)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-14 17:48:41 +02:00
1 parent 5f5e26a8d4
commit 7c16d424ce
5 files changed
+38 -15

No files matched your search

@@ -155,6 +155,7 @@ class Updater {
private unsubscribeNativeEvents: (() => void) | null = null;
private unsubscribeDesktopUpdate: (() => void) | null = null;
private desktopUpdateReported = false;
private desktopUpdateReportedReplacesShell = false;
private desktopUpdateRunning = false;
private olderShellModuleUpdateReady = false;
private olderShellUpdateDownloaded = false;
@@ -203,6 +204,10 @@ class Updater {
return this.desktopUpdateReported || this.olderShellModuleUpdateReady || this.olderShellUpdateAvailable;
}
get desktopUpdateReplacesShell(): boolean {
return (this.desktopUpdateReported && this.desktopUpdateReportedReplacesShell) || this.olderShellUpdateAvailable;
}
private get olderShellUpdateAvailable(): boolean {
const electronApi = getElectronAPI();
if (electronApi == null || electronApi.desktopUpdate != null || electronApi.updaterInstall == null) {
@@ -281,6 +286,7 @@ class Updater {
this.unsubscribeDesktopUpdate = desktopUpdate.onStateChanged((state) => {
runInAction(() => {
this.desktopUpdateReported = state.available;
this.desktopUpdateReportedReplacesShell = state.replacesShell === true;
this.desktopUpdateRunning = state.updating === true;
});
});
@@ -314,6 +320,7 @@ class Updater {
const state = await desktopUpdate.state();
runInAction(() => {
this.desktopUpdateReported = state.available;
this.desktopUpdateReportedReplacesShell = state.replacesShell === true;
this.desktopUpdateRunning = state.updating === true;
});
} catch (error) {
@@ -669,6 +676,7 @@ class Updater {
this.unsubscribeDesktopUpdate = null;
}
this.desktopUpdateReported = false;
this.desktopUpdateReportedReplacesShell = false;
this.desktopUpdateRunning = false;
this.olderShellModuleUpdateReady = false;
this.olderShellUpdateDownloaded = false;