Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: clear unnecessary view state when adding new tab (#14094)
Liu Ji2e1c64282e69
diff --git a/frontend/src/views/sql-editor/EditorPanel/context/index.ts b/frontend/src/views/sql-editor/EditorPanel/context/index.tsindex ef945b9ae2..5bf624ad54 100644--- a/frontend/src/views/sql-editor/EditorPanel/context/index.ts+++ b/frontend/src/views/sql-editor/EditorPanel/context/index.ts@@ -74,7 +74,9 @@ export const provideEditorPanelContext = (base: {const cloneViewState = (from: string, to: string) => {const vs = viewStateByTab.get(from);if (!vs) return;- viewStateByTab.set(to, cloneDeep(vs));+ const cloned = cloneDeep(vs);+ viewStateByTab.set(to, cloned);+ return cloned;};watch(diff --git a/frontend/src/views/sql-editor/TabList/TabList.vue b/frontend/src/views/sql-editor/TabList/TabList.vueindex 2e878bcddb..fa608b6e18 100644--- a/frontend/src/views/sql-editor/TabList/TabList.vue+++ b/frontend/src/views/sql-editor/TabList/TabList.vue@@ -142,7 +142,11 @@ const handleAddTab = () => {);const newTab = tabStore.addTab(clonedTab);if (fromTab) {- cloneViewState(fromTab.id, newTab.id);+ const vs = cloneViewState(fromTab.id, newTab.id);+ if (vs) {+ vs.view = "CODE";+ vs.detail = {};+ }}nextTick(recalculateScrollState);sheetEvents.emit("add-sheet");