mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(feed post): gif thumbnail could break persistently
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user