fix(desktop): stop sidecars before updater install

This commit is contained in:
Relakkes Yang
2026-04-25 13:21:31 +08:00
parent 0ef020ebf8
commit 55c5958b55
5 changed files with 67 additions and 9 deletions
+5 -1
View File
@@ -191,11 +191,12 @@ export const useUpdateStore = create<UpdateStore>((set, get) => ({
try {
writeDismissedUpdateVersion(null)
const { invoke } = await import('@tauri-apps/api/core')
const { relaunch } = await import('@tauri-apps/plugin-process')
let totalBytes: number | null = null
let downloadedBytes = 0
await update.downloadAndInstall((event) => {
await update.download((event) => {
if (event.event === 'Started') {
totalBytes = event.data.contentLength ?? null
downloadedBytes = 0
@@ -226,6 +227,9 @@ export const useUpdateStore = create<UpdateStore>((set, get) => ({
}
})
await invoke('prepare_for_update_install')
await update.install()
set((state) => ({
...state,
status: 'restarting',