From 360bd0da7bcd671a39710482d49e2c66bf35cbfa Mon Sep 17 00:00:00 2001 From: 10G Meow <10gmeow@gmail.com> Date: Fri, 28 Nov 2025 21:12:40 +0200 Subject: [PATCH] Fix PDF download issue --- src/plugins/utils.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/utils.js b/src/plugins/utils.js index cc3f10c..230e1cc 100644 --- a/src/plugins/utils.js +++ b/src/plugins/utils.js @@ -858,7 +858,7 @@ class Util { */ makeUniqueAvatar(image) { var list = png.splitChunk(image); - + // append var iend = list.pop(); // remove IEND var newchunk = png.createChunk("tEXt","Comment\0Keanu avatar - " + this.randomPass()); @@ -882,7 +882,7 @@ class Util { onlyContentUri: false, }; let data = response.data; - + // If making a system unique avatar, we add a random PNG header in here if (makeUnique) { data = this.makeUniqueAvatar(data); @@ -1069,7 +1069,7 @@ class Util { if (match) { // Extract components and convert to numbers. Note that months are 0-indexed. const year = parseInt(match[1], 10); - const month = parseInt(match[2], 10) - 1; + const month = parseInt(match[2], 10) - 1; const day = parseInt(match[3], 10); const hour = parseInt(match[4], 10); const minute = parseInt(match[5], 10); @@ -1139,10 +1139,7 @@ class Util { const link = document.createElement("a"); link.href = url; link.target = "_blank"; - if (!this.isFileTypePDF(event)) { - // PDFs are shown inline, not downloaded - link.download = event.getContent().body || this.$t("fallbacks.download_name"); - } + link.download = event.getContent().body || this.$t("fallbacks.download_name"); console.log("LINK", link); document.body.appendChild(link); link.click();