From 9755191104735706353033a258b7c89b006e619d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 12 Oct 2022 16:05:22 +0530 Subject: [PATCH] fix(gui): convert computed dependencies to reactive for proper functioning Signed-off-by: Pranav C --- packages/nc-gui/composables/useViewFilters.ts | 7 +++++-- packages/nc-gui/composables/useViewSorts.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useViewFilters.ts b/packages/nc-gui/composables/useViewFilters.ts index 7349996e5a..8369d35141 100644 --- a/packages/nc-gui/composables/useViewFilters.ts +++ b/packages/nc-gui/composables/useViewFilters.ts @@ -22,9 +22,10 @@ export function useViewFilters( parentId?: string, autoApply?: ComputedRef, reloadData?: () => void, - currentFilters?: Filter[], + _currentFilters?: Filter[], isNestedRoot?: boolean, ) { + let currentFilters = $ref(_currentFilters) const reloadHook = inject(ReloadViewDataHookInj) const { nestedFilters } = useSmartsheetStoreOrThrow() @@ -44,7 +45,9 @@ export function useViewFilters( const tabMeta = inject(TabMetaInj, ref({ filterState: new Map() } as TabItem)) const filters = computed({ - get: () => (nestedMode.value ? currentFilters! : _filters.value), + get: () => { + return nestedMode.value ? currentFilters! : _filters.value + }, set: (value: Filter[]) => { if (nestedMode.value) { currentFilters = value diff --git a/packages/nc-gui/composables/useViewSorts.ts b/packages/nc-gui/composables/useViewSorts.ts index a128f0f82c..f86eaf84c1 100644 --- a/packages/nc-gui/composables/useViewSorts.ts +++ b/packages/nc-gui/composables/useViewSorts.ts @@ -13,6 +13,7 @@ import { useSmartsheetStoreOrThrow, useUIPermission, } from '#imports' +import { TabItem } from '~/lib' export function useViewSorts(view: Ref, reloadData?: () => void) { const { sharedView } = useSharedView()