added logic to skip favorite collections and add empty collections to upload collection selector

This commit is contained in:
Abhinav-grd 2021-02-16 17:22:18 +05:30
parent 85f17f0108
commit 6bb32f5c24

View file

@ -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;