fix(updater): fix restart after update

This commit is contained in:
t8y2
2026-05-09 18:08:06 +08:00
parent 4b0681f5af
commit 8d318a2146
5 changed files with 14 additions and 7 deletions
+6 -2
View File
@@ -91,8 +91,12 @@ export function useAppUpdater() {
async function restartApp() {
if (!isTauriRuntime()) return;
const { exit } = await import("@tauri-apps/plugin-process");
await exit(0);
try {
const { relaunch } = await import("@tauri-apps/plugin-process");
await relaunch();
} catch (e: any) {
toast(t("updates.restartFailed", { error: e?.message || String(e) }), 5000);
}
}
return {