added array length check, added podfile.lock in .gitignore

This commit is contained in:
Sadaqat Ali 2022-09-26 21:53:42 +05:00
parent 929df786b2
commit 776ae89d57
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View File

@ -68,3 +68,4 @@ package-lock.json
my-release-key.keystore
gradle.properties
ios/Ecency.xcworkspace/xcuserdata/f.xcuserdatad/UserInterfaceState.xcuserstate
ios/Podfile.lock

View File

@ -221,7 +221,8 @@ export const extractMetadata = (body: string, thumbUrl?: string) => {
const mUrls = extractUrls(body);
const mUsers = body && body.match(userReg);
const matchedImages = extractImageUrls({urls:mUrls}).filter((element,index) => index < 10); //filter only first 10 images
const extractedImages = extractImageUrls({urls:mUrls});
const matchedImages = extractedImages.length ? extractedImages.filter((element,index) => index < 10) : []; //filter only first 10 images
const matchedLinks = [];
const matchedUsers = [];