Allow preview of thread images

This commit is contained in:
N Pex 2023-08-07 15:47:52 +00:00
parent e43b08dc64
commit 0ff2884429
5 changed files with 95 additions and 38 deletions

View file

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