fix(desktop): keep window tabs across app close (#34807)

This commit is contained in:
Luke Parker
2026-07-01 23:23:11 +00:00
committed by GitHub
parent 3df5556223
commit f266e829cf
6 changed files with 192 additions and 41 deletions
+18 -1
View File
@@ -4,6 +4,7 @@ import { UPDATER_ENABLED } from "./constants"
import { createUpdaterController, type UpdaterReadyRecord } from "./updater-controller"
import { getLogger } from "./logging"
import { getStore } from "./store"
import { setAppQuitting } from "./windows"
const { autoUpdater } = pkg
const key = "ready"
@@ -27,7 +28,23 @@ export function setupAutoUpdater(stop: () => Promise<void>) {
return createUpdaterController({
enabled: UPDATER_ENABLED,
currentVersion: app.getVersion(),
backend: autoUpdater,
backend: {
checkForUpdates: () => autoUpdater.checkForUpdates(),
downloadUpdate: () => autoUpdater.downloadUpdate(),
quitAndInstall: () => {
// quitAndInstall closes all windows before emitting before-quit, so
// flag the quit first to keep window ids persisted for restore.
setAppQuitting()
try {
autoUpdater.quitAndInstall()
} catch (error) {
// The install failed and the app keeps running; clear the flag so
// deliberate window closes prune ids again.
setAppQuitting(false)
throw error
}
},
},
persistence: {
get() {
const value = store.get(key)