From 4723358d2d7489b65288cc9e4eafd40d94e69903 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 5 Oct 2023 18:01:18 +0800 Subject: [PATCH] Fix borked image when restore from draft --- src/components/compose.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index bd360bf1..a92af771 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -1477,7 +1477,8 @@ function MediaAttachment({ onRemove = () => {}, }) { const supportsEdit = supports('@mastodon/edit-media-attributes'); - const { url, type, id } = attachment; + const { type, id, file } = attachment; + const url = file ? URL.createObjectURL(file) : attachment.url; console.log({ attachment }); const [description, setDescription] = useState(attachment.description); const suffixType = type.split('/')[0];