fix catalog gifs

This commit is contained in:
Tom (plebeius.eth)
2024-09-04 17:29:48 +02:00
parent 5a56016c85
commit 9191dd7cae
+3 -3
View File
@@ -66,7 +66,9 @@ export const CatalogPostMedia = ({ commentMediaInfo, isOutOfFeed, linkWidth, lin
let thumbnailComponent: React.ReactNode = null;
if (type === 'image' && !hasError) {
if (type === 'gif' && gifFrameUrl && !hasError) {
thumbnailComponent = <img src={gifFrameUrl} alt='' onLoad={handleLoad} onError={handleError} style={loadingStyle} />;
} else if (type === 'image' && !hasError) {
thumbnailComponent = <img src={url} alt='' onLoad={handleLoad} onError={handleError} style={loadingStyle} />;
} else if (type === 'video' && !hasError) {
thumbnailComponent = thumbnail ? (
@@ -79,8 +81,6 @@ export const CatalogPostMedia = ({ commentMediaInfo, isOutOfFeed, linkWidth, lin
thumbnailComponent = <img src={thumbnail} alt='' onLoad={handleLoad} onError={handleError} style={loadingStyle} />;
} else if (type === 'iframe' && iframeThumbnail && !hasError) {
thumbnailComponent = <img src={iframeThumbnail} alt='' onLoad={handleLoad} onError={handleError} style={loadingStyle} />;
} else if (type === 'gif' && !hasError) {
thumbnailComponent = <img src={gifFrameUrl || url} alt='' onLoad={handleLoad} onError={handleError} style={loadingStyle} />;
} else if (type === 'audio') {
thumbnailComponent = <audio src={url} controls />;
}