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(
() => activeView.value?.id,
(n, o) => {
if (n !== o && (hookId || !webHook)) loadFilters(hookId as string)
},
{ immediate: true },
if (!nested && n !== o && (hookId || !webHook)) loadFilters(hookId as string)
}
)
loadFilters(hookId as string)
watch(
() => nonDeletedFilters.value.length,
(length) => {

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

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

Loading…
Cancel
Save