Browse Source

fix(gui): convert computed dependencies to reactive for proper functioning

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3370/head
Pranav C 2 years ago
parent
commit
9755191104
  1. 7
      packages/nc-gui/composables/useViewFilters.ts
  2. 1
      packages/nc-gui/composables/useViewSorts.ts

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

@ -22,9 +22,10 @@ export function useViewFilters(
parentId?: string,
autoApply?: ComputedRef<boolean>,
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<Filter[]>({
get: () => (nestedMode.value ? currentFilters! : _filters.value),
get: () => {
return nestedMode.value ? currentFilters! : _filters.value
},
set: (value: Filter[]) => {
if (nestedMode.value) {
currentFilters = value

1
packages/nc-gui/composables/useViewSorts.ts

@ -13,6 +13,7 @@ import {
useSmartsheetStoreOrThrow,
useUIPermission,
} from '#imports'
import { TabItem } from '~/lib'
export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () => void) {
const { sharedView } = useSharedView()

Loading…
Cancel
Save