fix(desktop): avoid relaunching without installing updates (#23806)

This commit is contained in:
Brendan Allan 2026-04-24 13:27:36 +08:00 committed by GitHub
commit 2e156b8990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 34 additions and 19 deletions

View file

@ -297,10 +297,15 @@ const createPlatform = (): Platform => {
return { updateAvailable: true, version: next.version }
},
update: async () => {
updateAndRestart: async () => {
if (!UPDATER_ENABLED || !update) return
if (ostype() === "windows") await commands.killSidecar().catch(() => undefined)
await update.install().catch(() => undefined)
const installed = await update
.install()
.then(() => true)
.catch(() => false)
if (!installed) return
await relaunch()
},
restart: async () => {