Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

chore(worker.ts):guard-added-to-prevent-side-effects

Aswin Asokdc7072cda51a
diff --git a/web/packages/new/photos/services/search/worker.ts b/web/packages/new/photos/services/search/worker.ts
index a48a62460a..200f154fa3 100644
--- a/web/packages/new/photos/services/search/worker.ts
+++ b/web/packages/new/photos/services/search/worker.ts
@@ -398,13 +398,16 @@ const locationSuggestions = (
const filterSearchableFiles = (
{ files, collectionFiles }: SearchCollectionsAndFiles,
suggestion: SearchSuggestion,
-) =>
- sortMatchesIfNeeded(
+) => {
+ if (suggestion.type == "sidebarAction") return [];
+
+ return sortMatchesIfNeeded(
(suggestion.type == "collection" ? collectionFiles : files).filter(
(f) => isMatchingFile(f, suggestion),
),
suggestion,
);
+};
/**
* Return true if file satisfies the given {@link query}.
@@ -448,6 +451,9 @@ const isMatchingFile = (file: EnteFile, suggestion: SearchSuggestion) => {
case "person":
return suggestion.person.fileIDs.includes(file.id);
+
+ case "sidebarAction":
+ return false;
}
};