diff --git a/src/components/comment-media/comment-media.tsx b/src/components/comment-media/comment-media.tsx index 604c4910..5ec52d13 100644 --- a/src/components/comment-media/comment-media.tsx +++ b/src/components/comment-media/comment-media.tsx @@ -391,7 +391,7 @@ const CommentMedia = ({ const isMobile = useIsMobile(); const { thumbnailHeight, thumbnailWidth, url } = commentMediaInfo || {}; let type = commentMediaInfo?.type; - const gifFrameUrl = useFetchGifFirstFrame(url); + const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? url : undefined); if (type === 'gif' && gifFrameUrl) { type = 'animated gif'; diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 2b3cee36..2169aafe 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -543,7 +543,7 @@ const PostMedia = ({ const { t } = useTranslation(); const { url } = commentMediaInfo || {}; let type = commentMediaInfo?.type; - const gifFrameUrl = useFetchGifFirstFrame(url); + const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? url : undefined); const directories = useDirectories(); if (type === 'gif' && gifFrameUrl !== null) { diff --git a/src/components/post-form/post-form.tsx b/src/components/post-form/post-form.tsx index 7b2e1638..4dea216f 100644 --- a/src/components/post-form/post-form.tsx +++ b/src/components/post-form/post-form.tsx @@ -38,7 +38,7 @@ export const LinkTypePreviewer = ({ link }: { link: string }) => { const { t } = useTranslation(); const mediaInfo = getLinkMediaInfo(link); let type = mediaInfo?.type; - const gifFrameUrl = useFetchGifFirstFrame(mediaInfo?.url); + const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? mediaInfo?.url : undefined); if (type === 'gif' && gifFrameUrl !== null) { type = t('animated_gif');