fix(connection): clear parsed state when switching profiles

This commit is contained in:
zipg authored and GitHub committed 2026-08-18 15:24:01 +08:00
1 parent 168f2a472b
commit 9051ad35b8
3 files changed
+141 -5

No files matched your search

@@ -2770,6 +2770,10 @@ function defaultDatabaseForProfile() {
}
function onDbTypeChange(val: string) {
if (!editingId.value && val === selectedType.value) return;
if (!editingId.value) {
resetForm({ preservePickerState: true });
}
const category = dbCategoryForOption(val);
if (category) selectedDbCategory.value = category;
customDriverName.value = "";
@@ -4848,7 +4852,7 @@ function openJdbcDriverManagerFromError() {
openJdbcDriverManager();
}
function resetForm() {
function resetForm(options: { preservePickerState?: boolean } = {}) {
editingId.value = null;
form.value = defaultForm();
resetConnectionNoteVisibilityDraft(connectionNoteVisibilityDraft, settingsStore.editorSettings.sidebarShowConnectionNotes);
@@ -4870,10 +4874,12 @@ function resetForm() {
appliedConnectionUrlInput.value = "";
resetMeilisearchHostInput();
oracleTnsAdminPath.value = "";
dialogStep.value = "select";
dbSearchQuery.value = "";
selectedDbCategory.value = "sql";
configTab.value = "connection";
if (!options.preservePickerState) {
dialogStep.value = "select";
dbSearchQuery.value = "";
selectedDbCategory.value = "sql";
configTab.value = "connection";
}
resetVisibleDatabaseDraftState();
resetVisibleNacosNamespaceDraftState();
resetProductionDatabaseDraftState();