download pdf file fixes

This commit is contained in:
10G Meow 2022-02-13 11:31:41 +02:00
parent 66f18a7df2
commit 339452e607
3 changed files with 11 additions and 7 deletions

View file

@ -1526,10 +1526,14 @@ export default {
const link = document.createElement("a");
link.href = url;
link.target = "_blank";
link.download =
event.getContent().body || this.$t("fallbacks.download_name");
link.download = event.getContent().body || this.$t("fallbacks.download_name");
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(url);
setTimeout(function(){
document.body.removeChild(link);
URL.revokeObjectURL(url);
}, 200)
})
.catch((err) => {
console.log("Failed to fetch attachment: ", err);