Browse Source

fix(gui): load comments count only in grid

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3655/head
Pranav C 2 years ago
parent
commit
bdbf0c13ad
  1. 1
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  2. 3
      packages/nc-gui/composables/useViewData.ts

1
packages/nc-gui/components/virtual-cell/components/ListChildItems.vue

@ -78,6 +78,7 @@ const container = computed(() =>
const expandedFormDlg = ref(false) const expandedFormDlg = ref(false)
const expandedFormRow = ref() const expandedFormRow = ref()
/** reload children list whenever cell value changes and list is visible */
watch( watch(
() => props.cellValue, () => props.cellValue,
() => { () => {

3
packages/nc-gui/composables/useViewData.ts

@ -1,3 +1,4 @@
import { ViewTypes } from 'nocodb-sdk'
import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue' import type { ComputedRef, Ref } from 'vue'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
@ -174,8 +175,10 @@ export function useViewData(
: await fetchSharedViewData() : await fetchSharedViewData()
formattedData.value = formatData(response.list) formattedData.value = formatData(response.list)
paginationData.value = response.pageInfo paginationData.value = response.pageInfo
if (viewMeta.value?.type === ViewTypes.GRID) {
await loadAggCommentsCount() await loadAggCommentsCount()
} }
}
async function loadGalleryData() { async function loadGalleryData() {
if (!viewMeta?.value?.id) return if (!viewMeta?.value?.id) return

Loading…
Cancel
Save