Browse Source

fix(nc-gui): file-saver import issue (#7718)

1-command-setup
Ramesh Mane 9 months ago committed by GitHub
parent
commit
fb76b34aa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      packages/nc-gui/components/cell/attachment/utils.ts

3
packages/nc-gui/components/cell/attachment/utils.ts

@ -1,6 +1,7 @@
import type { AttachmentReqType, AttachmentType } from 'nocodb-sdk' import type { AttachmentReqType, AttachmentType } from 'nocodb-sdk'
import { populateUniqueFileName } from 'nocodb-sdk' import { populateUniqueFileName } from 'nocodb-sdk'
import DOMPurify from 'isomorphic-dompurify' import DOMPurify from 'isomorphic-dompurify'
import { saveAs } from 'file-saver'
import RenameFile from './RenameFile.vue' import RenameFile from './RenameFile.vue'
import { import {
ColumnInj, ColumnInj,
@ -317,7 +318,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
async function downloadFile(item: AttachmentType) { async function downloadFile(item: AttachmentType) {
const src = await getAttachmentSrc(item) const src = await getAttachmentSrc(item)
if (src) { if (src) {
;(await import('file-saver')).saveAs(src, item.title) saveAs(src, item.title)
} else { } else {
message.error('Failed to download file') message.error('Failed to download file')
} }

Loading…
Cancel
Save