From 26349e67e5533e6994614c4d203edfe5c7ba10eb Mon Sep 17 00:00:00 2001 From: Abhinav Date: Fri, 10 Feb 2023 12:56:37 +0530 Subject: [PATCH] fix shared and trash file shown in search result --- src/components/PhotoFrame.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/PhotoFrame.tsx b/src/components/PhotoFrame.tsx index 09e5d5e41..ff7d0ac9d 100644 --- a/src/components/PhotoFrame.tsx +++ b/src/components/PhotoFrame.tsx @@ -190,8 +190,9 @@ const PhotoFrame = ({ } if ( - isSharedFile(user, item) && - activeCollection !== item.collectionID + (isInSearchMode || + activeCollection !== item.collectionID) && + isSharedFile(user, item) ) { return false; } @@ -202,7 +203,11 @@ const PhotoFrame = ({ ) { return false; } - if (activeCollection !== TRASH_SECTION && item.isTrashed) { + if ( + (isInSearchMode || + activeCollection !== TRASH_SECTION) && + item.isTrashed + ) { return false; } if (!idSet.has(item.id)) { @@ -210,8 +215,8 @@ const PhotoFrame = ({ activeCollection === ALL_SECTION || activeCollection === ARCHIVE_SECTION || activeCollection === TRASH_SECTION || - activeCollection === item.collectionID || - isInSearchMode + isInSearchMode || + activeCollection === item.collectionID ) { idSet.add(item.id); return true;