mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-26 23:05:00 +03:00
fixed glitch causing worng thumbs when limiting images in meta
This commit is contained in:
parent
b255225d61
commit
fe223e08af
@ -221,8 +221,7 @@ export const extractMetadata = (body: string, thumbUrl?: string) => {
|
||||
const mUrls = extractUrls(body);
|
||||
const mUsers = body && body.match(userReg);
|
||||
|
||||
const extractedImages = extractImageUrls({urls:mUrls});
|
||||
const matchedImages = extractedImages.length ? extractedImages.filter((element,index) => index < 10) : []; //filter only first 10 images
|
||||
const matchedImages = extractImageUrls({urls:mUrls});
|
||||
const matchedLinks = [];
|
||||
const matchedUsers = [];
|
||||
|
||||
@ -243,7 +242,7 @@ export const extractMetadata = (body: string, thumbUrl?: string) => {
|
||||
matchedImages.sort((item) => (item === thumbUrl ? -1 : 1));
|
||||
}
|
||||
|
||||
out.image = matchedImages;
|
||||
out.image = matchedImages.slice(0, 10); // return only first 10 images
|
||||
}
|
||||
|
||||
if (mUsers) {
|
||||
|
Loading…
Reference in New Issue
Block a user