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(desktop): clear connection error after successful test

Guoyu Su2b5aaa2a5429
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue
index 17ed1f51ea..cea62a8da4 100644
--- a/apps/desktop/src/components/connection/ConnectionDialog.vue
+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue
@@ -1918,6 +1918,7 @@ async function testConnection() {
mongoDriverMode.value = "legacy";
}
testResult.value = { ok: true, message: msg };
+ clearEditedConnectionErrorAfterSuccessfulTest();
} catch (e: any) {
if (runId !== testRunId) return;
const message = connectionErrorWithDriverUpdateHint(config, mongodbAuthFailureHint(String(e)));
@@ -1928,7 +1929,9 @@ async function testConnection() {
configTab.value = "advanced";
}
testResult.value = fallbackMessage ? { ok: true, message: fallbackMessage } : { ok: false, message };
- if (!fallbackMessage) {
+ if (fallbackMessage) {
+ clearEditedConnectionErrorAfterSuccessfulTest();
+ } else {
showConnectionError(message);
}
} finally {
@@ -1938,6 +1941,10 @@ async function testConnection() {
}
}
+function clearEditedConnectionErrorAfterSuccessfulTest() {
+ if (editingId.value) store.clearConnectionError(editingId.value);
+}
+
function applyConnectionUrlToForm(input: string): boolean {
try {
const draft = parseConnectionDeepLink(input);