feat(app): load heavy desktop assets on demand, update in place (#3343)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-09 03:53:57 +02:00
1 parent 5072488f1e
commit fc60d05f17
47 files changed
+4414 -1190

No files matched your search

@@ -133,6 +133,7 @@ class Updater {
private unsubscribeNativeEvents: (() => void) | null = null;
private unsubscribeDesktopUpdate: (() => void) | null = null;
private desktopUpdateReported = false;
private desktopUpdateRunning = false;
private olderShellModuleUpdateReady = false;
private olderShellUpdateDownloaded = false;
private olderShellInstallWhenDownloaded = false;
@@ -177,6 +178,10 @@ class Updater {
return this.snapshot.context.manualNativeDownloadInFlight;
}
get desktopUpdateInProgress(): boolean {
return this.desktopUpdateRunning;
}
get desktopUpdateAvailable(): boolean {
return this.desktopUpdateReported || this.olderShellModuleUpdateReady || this.olderShellUpdateAvailable;
}
@@ -258,6 +263,7 @@ class Updater {
this.unsubscribeDesktopUpdate = desktopUpdate.onStateChanged((state) => {
runInAction(() => {
this.desktopUpdateReported = state.available;
this.desktopUpdateRunning = state.updating === true;
});
});
await this.refreshDesktopUpdateState();
@@ -290,6 +296,7 @@ class Updater {
const state = await desktopUpdate.state();
runInAction(() => {
this.desktopUpdateReported = state.available;
this.desktopUpdateRunning = state.updating === true;
});
} catch (error) {
logger.warn('Failed to read the desktop update state', error);
@@ -735,6 +742,7 @@ class Updater {
this.unsubscribeDesktopUpdate = null;
}
this.desktopUpdateReported = false;
this.desktopUpdateRunning = false;
this.olderShellModuleUpdateReady = false;
this.olderShellUpdateDownloaded = false;
this.olderShellInstallWhenDownloaded = false;