Browse Source

fix: use local storage option of attachment only in public form

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3545/head
Pranav C 2 years ago
parent
commit
0ee6a6a214
  1. 5
      packages/nc-gui/components/cell/attachment/utils.ts

5
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<any[]>(() => (isPublic.value ? storedFiles.value : attachments.value))
const visibleItems = computed<any[]>(() => (isPublic.value && isForm.value ? storedFiles.value : attachments.value))
watch(files, (nextFiles) => nextFiles && onFileSelect(nextFiles))

Loading…
Cancel
Save