From dca0060ceacf70b436650678e0426176b2d1c33e Mon Sep 17 00:00:00 2001 From: Jonathan Poltak Samosir Date: Tue, 18 Jun 2024 16:51:42 +0700 Subject: [PATCH] Fix bug in blank list filtered search resulting in duped page annots --- src/dashboard-refactor/search-results/index.tsx | 2 +- src/search/background/index.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dashboard-refactor/search-results/index.tsx b/src/dashboard-refactor/search-results/index.tsx index fb8c7ed205..e30db8393a 100644 --- a/src/dashboard-refactor/search-results/index.tsx +++ b/src/dashboard-refactor/search-results/index.tsx @@ -677,7 +677,7 @@ export default class SearchResultsContainer extends React.Component< const noteB = this.props.noteData.byId[b] return noteB.displayTime - noteA.displayTime }) - ?.map((noteId, index) => { + .map((noteId, index) => { const zIndex = noteIds[notesType]?.length - index diff --git a/src/search/background/index.ts b/src/search/background/index.ts index d7c720a359..c026e9fb3c 100644 --- a/src/search/background/index.ts +++ b/src/search/background/index.ts @@ -507,11 +507,13 @@ export default class SearchBackground { .toArray() let autoSharedAnnotIds = new Set( annotPrivacyLevels - .filter((l) => - [ - AnnotationPrivacyLevels.SHARED, - AnnotationPrivacyLevels.SHARED_PROTECTED, - ].includes(l.privacyLevel), + .filter( + (l) => + [ + AnnotationPrivacyLevels.SHARED, + AnnotationPrivacyLevels.SHARED_PROTECTED, + ].includes(l.privacyLevel) && + !validAnnotIds.has(l.annotation), ) .map((l) => l.annotation), )