Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(updater): fix restart after update

t8y28d318a214619
diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json
index 26ab9c7b69..3451ced340 100644
--- a/src-tauri/capabilities/default.json
+++ b/src-tauri/capabilities/default.json
@@ -23,6 +23,7 @@
"fs:default",
"fs:allow-write-text-file",
"fs:allow-read-text-file",
+ "process:default",
"shell:allow-open",
"updater:default",
"window-state:default"
diff --git a/src/components/layout/UpdateDialog.vue b/src/components/layout/UpdateDialog.vue
index 542165f222..09d0565ea1 100644
--- a/src/components/layout/UpdateDialog.vue
+++ b/src/components/layout/UpdateDialog.vue
@@ -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>
diff --git a/src/composables/useAppUpdater.ts b/src/composables/useAppUpdater.ts
index 41f6be28c8..c6a253032f 100644
--- a/src/composables/useAppUpdater.ts
+++ b/src/composables/useAppUpdater.ts
@@ -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 {
diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts
index 9d8558211f..60229dd431 100644
--- a/src/i18n/locales/en.ts
+++ b/src/i18n/locales/en.ts
@@ -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",
diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts
index 37044e8dc7..76da0152a2 100644
--- a/src/i18n/locales/zh-CN.ts
+++ b/src/i18n/locales/zh-CN.ts
@@ -50,9 +50,10 @@ export default {
downloadAndInstall: "下载并安装",
downloading: "下载中 {progress}%",
downloadFailed: "更新下载失败:{error}",
- restart: "立即重启",
+ restart: "退出并重启",
+ restartFailed: "重启应用失败:{error}",
exitAndUpdate: "退出并更新",
- reopenHint: "更新将在重新打开应用后生效",
+ reopenHint: "应用将自动重启以完成更新",
},
sidebar: {
connections: "连接",