Added Download Option for Drafts/Base64

This commit is contained in:
2025-11-30 13:37:38 +01:00
parent de2692f704
commit 253b04ec0d

View File

@@ -127,7 +127,18 @@ const handleKeyPress = (event) => {
const downloadControl = computed(() => vpvRef.value?.downloadControl)
const handleDownloadFile = async () => {
await useFiles().downloadFile(props.fileId)
if(props.fileId){
await useFiles().downloadFile(props.fileId)
} else if(props.uri){
const a = document.createElement("a");
a.href = props.uri;
a.download = "entwurf.pdf";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
/*const downloadCtrl = unref(downloadControl)
if (!downloadCtrl) return
@@ -172,7 +183,7 @@ watch(downloadControl, (downloadCtrl) => {
variant="outline"
></UButton>
<UButton
v-if="props.fileId"
v-if="props.fileId || props.uri"
@click="handleDownloadFile"
variant="outline"
icon="i-heroicons-arrow-down-on-square"