mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-29 08:11:06 +00:00
fix(updater): fix restart after update
This commit is contained in:
@@ -84,7 +84,7 @@ const renderedNotes = computed(() => {
|
||||
<Button variant="outline" @click="emit('open-latest-release')">{{ t("updates.openRelease") }}</Button>
|
||||
<template v-if="isDesktop">
|
||||
<div v-if="updateReady" class="flex flex-col items-end gap-1">
|
||||
<Button @click="emit('restart')">{{ t("updates.exitAndUpdate") }}</Button>
|
||||
<Button @click="emit('restart')">{{ t("updates.restart") }}</Button>
|
||||
<span class="text-xs text-muted-foreground">{{ t("updates.reopenHint") }}</span>
|
||||
</div>
|
||||
<Button v-else-if="isDownloadingUpdate" disabled>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -51,9 +51,10 @@ export default {
|
||||
downloadAndInstall: "Download & Install",
|
||||
downloading: "Downloading {progress}%",
|
||||
downloadFailed: "Update download failed: {error}",
|
||||
restart: "Restart Now",
|
||||
restart: "Exit & Restart",
|
||||
restartFailed: "Failed to restart app: {error}",
|
||||
exitAndUpdate: "Exit & Update",
|
||||
reopenHint: "Changes will take effect when you reopen the app",
|
||||
reopenHint: "The app will relaunch to finish updating",
|
||||
},
|
||||
sidebar: {
|
||||
connections: "CONNECTIONS",
|
||||
|
||||
@@ -50,9 +50,10 @@ export default {
|
||||
downloadAndInstall: "下载并安装",
|
||||
downloading: "下载中 {progress}%",
|
||||
downloadFailed: "更新下载失败:{error}",
|
||||
restart: "立即重启",
|
||||
restart: "退出并重启",
|
||||
restartFailed: "重启应用失败:{error}",
|
||||
exitAndUpdate: "退出并更新",
|
||||
reopenHint: "更新将在重新打开应用后生效",
|
||||
reopenHint: "应用将自动重启以完成更新",
|
||||
},
|
||||
sidebar: {
|
||||
connections: "连接",
|
||||
|
||||
Reference in New Issue
Block a user