fix(catalog): large image size was incorrect

This commit is contained in:
Tom (plebeius.eth)
2024-06-21 10:40:51 +02:00
parent 62587beff1
commit b5b5c5ca46
+3 -2
View File
@@ -34,8 +34,10 @@ export const CatalogPostMedia = ({ commentMediaInfo, isOutOfFeed, linkWidth, lin
const handleError = () => setHasError(true);
const loadingStyle = { display: isLoaded ? 'block' : 'none' };
const { imageSize } = useCatalogStyleStore();
let displayWidth, displayHeight;
const maxThumbnailSize = 150;
const maxThumbnailSize = imageSize === 'Large' ? 250 : 150;
if (linkWidth && linkHeight) {
let scale = Math.min(1, maxThumbnailSize / Math.max(linkWidth, linkHeight));
@@ -51,7 +53,6 @@ export const CatalogPostMedia = ({ commentMediaInfo, isOutOfFeed, linkWidth, lin
displayHeight = 'unset';
}
const { imageSize } = useCatalogStyleStore();
const maxWidth = imageSize === 'Large' ? '250px' : '150px';
const maxHeight = imageSize === 'Large' ? '250px' : '150px';