This commit is contained in:
isUnknown 2025-01-07 16:54:08 +01:00
parent bff0f8eda3
commit cb1f842fc9
4 changed files with 53 additions and 14 deletions

View file

@ -43,6 +43,7 @@ const { activeTrack } = defineProps({
// Helper
const { openedFile } = storeToRefs(useDialogStore());
const virtualSampleStore = useVirtualSampleStore();
const { isDownloadTriggered } = storeToRefs(useVirtualSampleStore());
const isHelperHidden = ref(localStorage.getItem("isHelperHidden"));
localStorage.setItem("isHelperHidden", true);
@ -187,4 +188,16 @@ function preloadImages() {
image.src = imageUrl;
});
}
// Download image
watch(isDownloadTriggered, (newValue) => {
if (!newValue) return;
const downloadNode = document.createElement("a");
downloadNode.setAttribute("href", currentFile.value.source);
downloadNode.setAttribute("download", "");
document.body.appendChild(downloadNode);
downloadNode.click();
document.body.removeChild(downloadNode);
});
</script>