Browse Source

fix(gui): avoid setting filter list data for nested from state

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3370/head
Pranav C 2 years ago
parent
commit
735bcb6017
  1. 7
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 9
      packages/nc-gui/composables/useViewFilters.ts

7
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -86,11 +86,12 @@ const types = computed(() => {
watch( watch(
() => activeView.value?.id, () => activeView.value?.id,
(n, o) => { (n, o) => {
if (n !== o && (hookId || !webHook)) loadFilters(hookId as string) if (!nested && n !== o && (hookId || !webHook)) loadFilters(hookId as string)
}, }
{ immediate: true },
) )
loadFilters(hookId as string)
watch( watch(
() => nonDeletedFilters.value.length, () => nonDeletedFilters.value.length,
(length) => { (length) => {

9
packages/nc-gui/composables/useViewFilters.ts

@ -51,11 +51,11 @@ export function useViewFilters(
set: (value: Filter[]) => { set: (value: Filter[]) => {
if (nestedMode.value) { if (nestedMode.value) {
currentFilters = value currentFilters = value
if (isNestedRoot) nestedFilters.value = value if (isNestedRoot) {
nestedFilters.value = value
nestedFilters.value = [...nestedFilters.value]
tabMeta.value.filterState!.set(view!.value.id!, nestedFilters.value) tabMeta.value.filterState!.set(view!.value.id!, nestedFilters.value)
}
nestedFilters.value = [...nestedFilters.value]
reloadHook?.trigger() reloadHook?.trigger()
return return
} }
@ -77,6 +77,7 @@ export function useViewFilters(
const loadFilters = async (hookId?: string) => { const loadFilters = async (hookId?: string) => {
if (nestedMode.value) { if (nestedMode.value) {
if (isNestedRoot)
filters.value = tabMeta.value.filterState!.get(view.value.id!) || [] filters.value = tabMeta.value.filterState!.get(view.value.id!) || []
return return
} }

Loading…
Cancel
Save