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
+1 -1
View File
@@ -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');