From 9a6ea8fc6d4601531c053849acfb95af6cb2e4bd Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Tue, 8 Apr 2025 21:14:43 -0500 Subject: [PATCH] make image popups work again for embeds --- src/webpage/embed.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/webpage/embed.ts b/src/webpage/embed.ts index 0c3bdc2..c0ef970 100644 --- a/src/webpage/embed.ts +++ b/src/webpage/embed.ts @@ -173,9 +173,18 @@ class Embed { generateImage() { const img = createImg(this.json.thumbnail.proxy_url); img.classList.add("messageimg"); - img.onclick = function () { + img.onclick = () => { const full = new ImagesDisplay([ - new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null), + new File( + { + id: "", + filename: "", + url: this.json.thumbnail.proxy_url, + size: -1, + content_type: "image/", + }, + null, + ), ]); full.show(); }; @@ -212,7 +221,7 @@ class Embed { img.classList.add("embedimg"); img.onclick = function () { const full = new ImagesDisplay([ - new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null), + new File({id: "", filename: "", url: img.src, size: -1, content_type: "image/"}, null), ]); full.show(); }; @@ -390,7 +399,7 @@ class Embed { } else { img.onclick = async () => { const full = new ImagesDisplay([ - new File({id: "", filename: "", url: img.src, size: -1, content_type: "image"}, null), + new File({id: "", filename: "", url: img.src, size: -1, content_type: "image/"}, null), ]); full.show(); };