From 2c36fcec2b2d01d49a3623ba1595a37e2f1793b4 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 16 Jan 2023 18:55:00 +0800 Subject: [PATCH] fix(nc-gui): get public gallery data from sharedView.view --- packages/nc-gui/composables/useViewData.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index b572c9aea2..96e8d45ede 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -49,7 +49,9 @@ export function useViewData( const { getMeta } = useMetas() const appInfoDefaultLimit = appInfo.defaultLimit || 25 + const _paginationData = ref({ page: 1, pageSize: appInfoDefaultLimit }) + const aggCommentCount = ref<{ row_id: string; count: number }[]>([]) const galleryData = ref() @@ -64,7 +66,7 @@ export function useViewData( const { project, isSharedBase } = useProject() - const { fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView() + const { sharedView, fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView() const { $api, $e } = useNuxtApp() @@ -203,8 +205,10 @@ export function useViewData( } async function loadGalleryData() { - if (!viewMeta?.value?.id || isPublic.value) return - galleryData.value = await $api.dbView.galleryRead(viewMeta.value.id) + if (!viewMeta?.value?.id) return + galleryData.value = isPublic.value + ? (sharedView.value?.view as GalleryType) + : await $api.dbView.galleryRead(viewMeta.value.id) } async function insertRow(