misc: remove thumb arg if width is high enough
This commit is contained in:
1 parent
3a12cfe9bb
commit
296313e508
1 file changed
+5
@@ -12,6 +12,11 @@ export const bestImageURL = (
|
|||||||
compact: boolean = true,
|
compact: boolean = true,
|
||||||
width: number = 1024
|
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)
|
if (compact && post.thumbnail_url)
|
||||||
return `${post.thumbnail_url}?thumbnail=256&format=webp`
|
return `${post.thumbnail_url}?thumbnail=256&format=webp`
|
||||||
else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp`
|
else if (compact && post.url) return `${post.url}?thumbnail=256&format=webp`
|
||||||
|
|||||||
Reference in new issue
Block a user