perf(media): restrict gif frame extraction to gif media types

This commit is contained in:
plebeius
2026-03-04 16:04:49 +08:00
parent df1bc2071d
commit 7644d59599
3 changed files with 3 additions and 3 deletions
@@ -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';