From 38f9fce779cc257d01adc9d966332a444baa7805 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Tue, 19 May 2026 10:33:03 +0800 Subject: [PATCH] fix(connection): open edit dialog with saved profile --- .../connection/ConnectionDialog.vue | 2 ++ .../src/components/layout/AppDialogs.vue | 5 ++-- .../connectionDialogEditOpen.test.ts | 30 +++++++++++++++++++ .../app-tests/startupChunkBoundaries.test.ts | 6 +++- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 packages/app-tests/connectionDialogEditOpen.test.ts diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index b74150c1a2..855b95a53f 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -241,6 +241,7 @@ const driverProfiles: Record< function profileForConfig(config: ConnectionConfig) { if (config.driver_profile && driverProfiles[config.driver_profile]) return config.driver_profile; + if (config.db_type === "dameng") return "dm"; return config.db_type; } @@ -336,6 +337,7 @@ watch( } resetTestState(); }, + { immediate: true }, ); const isEditing = ref(false); diff --git a/apps/desktop/src/components/layout/AppDialogs.vue b/apps/desktop/src/components/layout/AppDialogs.vue index c1c0d0c71e..adfa2ff8a5 100644 --- a/apps/desktop/src/components/layout/AppDialogs.vue +++ b/apps/desktop/src/components/layout/AppDialogs.vue @@ -70,6 +70,7 @@ const editConfig = computed(() => { if (!id) return undefined; return connectionStore.getConfig(id); }); +const shouldShowConnectionDialog = computed(() => props.showConnectionDialog || !!editConfig.value); watch(editConfig, (v) => { if (v) emit("update:showConnectionDialog", true); @@ -95,8 +96,8 @@ watch(