From 6bb32f5c24c2053db49be5e6524c5a7d62caa056 Mon Sep 17 00:00:00 2001 From: Abhinav-grd Date: Tue, 16 Feb 2021 17:22:18 +0530 Subject: [PATCH] added logic to skip favorite collections and add empty collections to upload collection selector --- src/services/collectionService.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/services/collectionService.ts b/src/services/collectionService.ts index f167d8b16..6227241ed 100644 --- a/src/services/collectionService.ts +++ b/src/services/collectionService.ts @@ -174,10 +174,18 @@ export const getCollectionAndItsLatestFile = ( } }); let allCollectionAndItsLatestFile: CollectionAndItsLatestFile[] = []; - for (const [collectionID, file] of latestFile) { + const userID = getData(LS_KEYS.USER).id; + + for (const [_, collection] of collectionMap) { + if ( + collection.owner.id != userID || + collection.type == CollectionType.favorites + ) { + continue; + } allCollectionAndItsLatestFile.push({ - collection: collectionMap.get(collectionID), - file, + collection, + file: latestFile.get(collection.id), }); } return allCollectionAndItsLatestFile;