From e7be5e679c11bf55f4ac1b6093cab0d493eb14ef Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 29 Nov 2022 16:15:21 +0530 Subject: [PATCH] don't show collections for trash files --- src/components/PhotoViewer/FileInfo/index.tsx | 40 +++++++++++-------- src/components/PhotoViewer/index.tsx | 1 + 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/components/PhotoViewer/FileInfo/index.tsx b/src/components/PhotoViewer/FileInfo/index.tsx index 97f18b6b2..d7704721a 100644 --- a/src/components/PhotoViewer/FileInfo/index.tsx +++ b/src/components/PhotoViewer/FileInfo/index.tsx @@ -44,6 +44,7 @@ interface Iprops { refreshPhotoswipe: () => void; fileToCollectionsMap: Map; collectionNameMap: Map; + isTrashCollection: boolean; } function BasicDeviceCamera({ @@ -77,6 +78,7 @@ export function FileInfo({ refreshPhotoswipe, fileToCollectionsMap, collectionNameMap, + isTrashCollection, }: Iprops) { const [location, setLocation] = useState(null); const [parsedExifData, setParsedExifData] = useState>(); @@ -244,23 +246,27 @@ export function FileInfo({ caption={formatTime(file.metadata.modificationTime / 1000)} hideEditOption /> - - } hideEditOption> - - {fileToCollectionsMap - .get(file.id) - ?.map((collectionID) => ( - - {collectionNameMap.get(collectionID)} - - ))} - - + {!isTrashCollection && ( + } hideEditOption> + + {fileToCollectionsMap + .get(file.id) + ?.filter((collectionID) => + collectionNameMap.has(collectionID) + ) + ?.map((collectionID) => ( + + {collectionNameMap.get(collectionID)} + + ))} + + + )}