From 5a56016c85bf5f7ac78af8ce3783e71c1eb8181b Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 4 Sep 2024 17:15:11 +0200 Subject: [PATCH] fix(post): some gifs would appear animated before expanded --- src/components/comment-media/comment-media.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/comment-media/comment-media.tsx b/src/components/comment-media/comment-media.tsx index 329a0739..ebdaf4ec 100644 --- a/src/components/comment-media/comment-media.tsx +++ b/src/components/comment-media/comment-media.tsx @@ -53,7 +53,9 @@ const Thumbnail = ({ commentMediaInfo, isFloatingEmbed, post, setShowThumbnail } const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? url : undefined); const hasThumbnail = getHasThumbnail(commentMediaInfo, url); - if (type === 'image') { + if (type === 'gif' && gifFrameUrl) { + thumbnailComponent = setShowThumbnail(false)} />; + } else if (type === 'image') { thumbnailComponent = setShowThumbnail(false)} />; } else if (type === 'video') { thumbnailComponent = thumbnail ? ( @@ -66,10 +68,6 @@ const Thumbnail = ({ commentMediaInfo, isFloatingEmbed, post, setShowThumbnail } thumbnailComponent = setShowThumbnail(false)} />; } else if (type === 'iframe') { thumbnailComponent = iframeThumbnail ? setShowThumbnail(false)} /> : null; - } else if (type === 'gif' && gifFrameUrl) { - thumbnailComponent = setShowThumbnail(false)} />; - } else if (type === 'gif' && !gifFrameUrl) { - thumbnailComponent = setShowThumbnail(false)} />; } else if (type === 'audio') { thumbnailComponent =