From 4986a5892fb00bd5a6b2065ad8cfefbc36052dd7 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 26 Dec 2022 18:00:37 +0530 Subject: [PATCH] fix(gui): replace api call which requires auth token in public page re #4694 Signed-off-by: Pranav C --- packages/nc-gui/composables/useSharedView.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useSharedView.ts b/packages/nc-gui/composables/useSharedView.ts index cb0c5ea8c5..f67a6c9561 100644 --- a/packages/nc-gui/composables/useSharedView.ts +++ b/packages/nc-gui/composables/useSharedView.ts @@ -17,7 +17,7 @@ export function useSharedView() { const { appInfo } = $(useGlobal()) - const { loadProject } = useProject() + const { project } = useProject() const appInfoDefaultLimit = appInfo.defaultLimit || 25 @@ -76,7 +76,16 @@ export function useSharedView() { await setMeta(viewMeta.model) - await loadProject(true, viewMeta.project_id) + // if project is not defined then set it with an object containing base + if (!project.value?.bases) + project.value = { + bases: [ + { + id: viewMeta.base_id, + type: viewMeta.client, + }, + ], + } const relatedMetas = { ...viewMeta.relatedMetas } Object.keys(relatedMetas).forEach((key) => setMeta(relatedMetas[key]))