Browse Source

Merge pull request #3492 from nocodb/fix/gui-v2-sign-out

fix(gui-v2): avoid watch logic to trigger even after signout
pull/3499/head
Raju Udava 2 years ago committed by GitHub
parent
commit
5f35cb5d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue
  2. 9
      packages/nc-gui-v2/composables/useViewColumns.ts

13
packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
import type ColumnFilter from './ColumnFilter.vue'
import { ActiveViewInj, IsLockedInj, IsPublicInj, computed, inject, ref, useGlobal, useViewFilters, watchEffect } from '#imports'
import { ActiveViewInj, IsLockedInj, IsPublicInj, computed, inject, ref, useGlobal, useViewFilters } from '#imports'
const isLocked = inject(IsLockedInj, ref(false))
@ -25,13 +25,14 @@ const { filters, loadFilters } = useViewFilters(
const filtersLength = ref(0)
watchEffect(async () => {
if (activeView?.value) {
watch(
() => activeView?.value,
async () => {
await loadFilters()
filtersLength.value = filters.value.length || 0
}
})
},
{ immediate: true },
)
const applyChanges = async () => await filterComp.value?.applyChanges()
</script>

9
packages/nc-gui-v2/composables/useViewColumns.ts

@ -202,7 +202,14 @@ export function useViewColumns(view: Ref<ViewType> | undefined, meta: ComputedRe
})
// reload view columns when table meta changes
watch(meta, () => loadViewColumns())
watch(
() => meta,
async (newVal, oldVal) => {
if (newVal !== oldVal && meta.value) {
await loadViewColumns()
}
},
)
return {
fields,

Loading…
Cancel
Save