fix(grid): preserve column filters across tab eviction
This commit is contained in:
7 files changed
+87
-1
No files matched your search
@@ -2089,6 +2089,16 @@ export const useQueryStore = defineStore("query", () => {
|
||||
}
|
||||
}
|
||||
|
||||
function updateDataGridLocalColumnFilters(id: string, filters: Record<string, string[]>) {
|
||||
const tab = tabs.value.find((item) => item.id === id);
|
||||
if (!tab?.result) return;
|
||||
if (Object.keys(filters).length === 0) {
|
||||
delete tab.result.local_column_filters;
|
||||
} else {
|
||||
tab.result.local_column_filters = Object.fromEntries(Object.entries(filters).map(([columnIndex, values]) => [columnIndex, [...values]]));
|
||||
}
|
||||
}
|
||||
|
||||
function setAutoCommit(id: string, autoCommit: boolean) {
|
||||
const tab = tabs.value.find((t) => t.id === id);
|
||||
if (tab) {
|
||||
@@ -4584,6 +4594,7 @@ export const useQueryStore = defineStore("query", () => {
|
||||
rollbackConnectionTransactions,
|
||||
rollbackDatabaseTransactions,
|
||||
updateSql,
|
||||
updateDataGridLocalColumnFilters,
|
||||
updateEditorViewport,
|
||||
updateEditorSelection,
|
||||
updateObjectBrowserViewport,
|
||||
|
||||
Reference in new issue
Block a user