1
0
Fork 0

Not all cards work in large size

Check the image aspect ratio before converting to large size
This commit is contained in:
Lim Chee Aun 2022-12-29 11:34:29 +08:00
parent 808d56432e
commit 160b535552

View file

@ -861,7 +861,8 @@ function Card({ card, size }) {
*/
const hasText = title || providerName || authorName;
size = size === 'l' ? 'large' : '';
const isLandscape = width / height >= 1.2;
size = size === 'l' && isLandscape ? 'large' : '';
if (hasText && image) {
const domain = new URL(url).hostname.replace(/^www\./, '');