fix(feed post): gif thumbnail could break persistently

This commit is contained in:
Tom (plebeius.eth)
2024-12-12 16:38:04 +01:00
parent 77bee78164
commit e3cf5076be
+7 -2
View File
@@ -75,8 +75,13 @@ const useFetchGifFirstFrame = (url: string | undefined) => {
try {
const cachedFrame = await getCachedGifFrame(url);
if (cachedFrame) {
if (isActive) setFrameUrl(cachedFrame);
return;
try {
const response = await fetch(cachedFrame);
if (response.ok) {
if (isActive) setFrameUrl(cachedFrame);
return;
}
} catch {}
}
const blob = typeof url === 'string' ? await parseGif(await fetchImage(url)) : await parseGif(await readImage(url as File));