From 3ae82d6898d06d0f6d8ae34e163c062783e09a26 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 16 Dec 2022 09:20:30 +0800 Subject: [PATCH] Handle "unknown" media On mastodon.social, images have type:image, but hachyderm returns type:unknown Found this when editing a post and add two images, on mastodon.social. --- src/components/status.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 595361ba..dc135046 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -54,7 +54,8 @@ function Media({ media, showOriginal, onClick }) { focalBackgroundPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`; } - if (type === 'image') { + if (type === 'image' || (type === 'unknown' && previewUrl && url)) { + // Note: type: unknown might not have width/height return (