Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix

Manav Rathi32315b1149c4
diff --git a/web/packages/new/photos/services/search/index.ts b/web/packages/new/photos/services/search/index.ts
index c87c19127d..c98416bc53 100644
--- a/web/packages/new/photos/services/search/index.ts
+++ b/web/packages/new/photos/services/search/index.ts
@@ -106,13 +106,15 @@ const suggestionsToOptions = async (suggestions: SearchSuggestion[]) =>
Promise.all(
suggestions.map(async (suggestion) => {
const matchingFiles = await filterSearchableFiles(suggestion);
- return {
- suggestion,
- fileCount: matchingFiles.length,
- previewFiles: matchingFiles.slice(0, 3),
- };
+ return matchingFiles.length
+ ? {
+ suggestion,
+ fileCount: matchingFiles.length,
+ previewFiles: matchingFiles.slice(0, 3),
+ }
+ : undefined;
}),
- );
+ ).then((r) => r.filter((o) => !!o));
/**
* Return the list of {@link EnteFile}s (from amongst the previously set