Skip to content

Commit

Permalink
Merge branch 'main' into _private
Browse files Browse the repository at this point in the history
  • Loading branch information
rwv committed Nov 18, 2023
2 parents aa89ac9 + 53c6433 commit cbfd6be
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/save-button/SaveButtonCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { NCard, NSpace, NIcon, NButton } from 'naive-ui'
import { DocumentDownload } from '@vicons/carbon'
import { AdfScannerOutlined } from '@vicons/material'
import { useI18n } from 'vue-i18n'
import { fileSave } from 'browser-fs-access'
const { t } = useI18n()
const props = defineProps<{
Expand All @@ -43,16 +45,17 @@ const emit = defineEmits<{
(e: 'generate'): void
}>()
const download = () => {
const download = async () => {
if (!props.pdf) return
const link = document.createElement('a')
const url = URL.createObjectURL(props.pdf)
link.href = url
link.download = props.pdf.name
link.click()
URL.revokeObjectURL(url)
link.remove()
await fileSave(props.pdf, {
fileName: props.pdf.name,
extensions: ['.pdf'],
mimeTypes: ['application/pdf'],
startIn: 'downloads',
description: 'PDF File',
id: 'lookscanned'
})
}
</script>
Expand Down

0 comments on commit cbfd6be

Please sign in to comment.