misc: remove thumb arg if width is high enough

This commit is contained in:
Xyphyn committed 2023-09-06 19:14:32 -07:00
1 parent 3a12cfe9bb
commit 296313e508
1 file changed
+5
+5
View File
@@ -12,6 +12,11 @@ export const bestImageURL = (
compact: boolean = true,
width: number = 1024
) => {
if (width > 1024) {
if (post.url) return `${post.url}?format=webp`
else if (post.thumbnail_url) return `${post.thumbnail_url}?format=webp`
}
if (compact && post.thumbnail_url)
return `${post.thumbnail_url}?thumbnail=256&format=webp`
else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp`