tauri: explicitly kill sidecar before updater relaunch

This commit is contained in:
Brendan Allan 2025-12-16 19:01:28 +08:00 committed by Aiden Cline
commit 331ece741f
2 changed files with 27 additions and 77 deletions

View file

@ -1,6 +1,7 @@
import { check, DownloadEvent } from "@tauri-apps/plugin-updater"
import { relaunch } from "@tauri-apps/plugin-process"
import { ask, message } from "@tauri-apps/plugin-dialog"
import { invoke } from "@tauri-apps/api/core"
export const UPDATER_ENABLED = window.__OPENCODE__?.updaterEnabled ?? false
@ -34,6 +35,7 @@ export async function runUpdater(onDownloadEvent?: (progress: DownloadEvent) =>
return false
}
await invoke("kill_sidecar")
await relaunch()
return true