From 0ee6a6a214e99143ef30700555533c0b001c80e6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 7 Sep 2022 22:05:19 +0530 Subject: [PATCH] fix: use local storage option of attachment only in public form Signed-off-by: Pranav C --- packages/nc-gui/components/cell/attachment/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/cell/attachment/utils.ts b/packages/nc-gui/components/cell/attachment/utils.ts index fd06f806b2..453aa345e8 100644 --- a/packages/nc-gui/components/cell/attachment/utils.ts +++ b/packages/nc-gui/components/cell/attachment/utils.ts @@ -18,6 +18,7 @@ import { useProject, watch, } from '#imports' +import { IsFormInj } from '~/context' import MdiPdfBox from '~icons/mdi/pdf-box' import MdiFileWordOutline from '~icons/mdi/file-word-outline' import MdiFilePowerpointBox from '~icons/mdi/file-powerpoint-box' @@ -37,6 +38,8 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( const isPublic = inject(IsPublicInj, ref(false)) + const isForm = inject(IsFormInj, ref(false)) + const meta = inject(MetaInj)! const column = inject(ColumnInj)! @@ -162,7 +165,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState( } /** our currently visible items, either the locally stored or the ones from db, depending on isPublicForm status */ - const visibleItems = computed(() => (isPublic.value ? storedFiles.value : attachments.value)) + const visibleItems = computed(() => (isPublic.value && isForm.value ? storedFiles.value : attachments.value)) watch(files, (nextFiles) => nextFiles && onFileSelect(nextFiles))