Skip to content

armgit / ente

Public Imported from GitHub
0

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

Move up

Manav Rathi87e31965e5a4
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 7a2a096b15..e882ea4196 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -407,7 +407,8 @@ export default function Gallery() {
};
}, []);
- useEffect(() => setSearchableFiles(files), [files]);
+ // TODO: Is this uniquing necessary? Doesn't seem like.
+ useEffect(() => setSearchableFiles(getUniqueFiles(files)), [files]);
useEffect(() => {
if (!user || !files || !collections || !hiddenFiles || !trashedFiles) {
@@ -526,7 +527,7 @@ export default function Gallery() {
let filteredFiles: EnteFile[] = [];
if (isInSearchMode) {
- filteredFiles = getUniqueFiles(await search(searchQuery));
+ filteredFiles = await search(searchQuery);
} else {
filteredFiles = getUniqueFiles(
(isInHiddenSection ? hiddenFiles : files).filter((item) => {
diff --git a/web/apps/photos/src/services/searchService.ts b/web/apps/photos/src/services/searchService.ts
index f10f9e95a3..7dd3e289c2 100644
--- a/web/apps/photos/src/services/searchService.ts
+++ b/web/apps/photos/src/services/searchService.ts
@@ -16,7 +16,6 @@ import {
import type { LocationTag } from "@/new/photos/services/user-entity";
import { type EnteFile } from "@/new/photos/types/file";
import { type Collection } from "types/collection";
-import { getUniqueFiles } from "utils/file";
// Suggestions shown in the search dropdown when the user has typed something.
export const getAutoCompleteSuggestions =
@@ -53,7 +52,7 @@ async function convertSuggestionsToOptions(
const previewImageAppendedOptions: SearchOption[] = [];
for (const suggestion of suggestions) {
const searchQuery = convertSuggestionToSearchQuery(suggestion);
- const resultFiles = getUniqueFiles(await search(searchQuery));
+ const resultFiles = await search(searchQuery);
if (searchQuery?.clip) {
resultFiles.sort((a, b) => {
const aScore = searchQuery.clip.get(a.id);