Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prune

Manav Rathic2ea68c39cab
diff --git a/web/apps/photos/src/components/SearchBar.tsx b/web/apps/photos/src/components/SearchBar.tsx
index 8d5fb0f063..e2649f661b 100644
--- a/web/apps/photos/src/components/SearchBar.tsx
+++ b/web/apps/photos/src/components/SearchBar.tsx
@@ -1,6 +1,5 @@
import { assertionFailed } from "@/base/assert";
import { useIsMobileWidth } from "@/base/hooks";
-import type { Collection } from "@/media/collection";
import { FileType } from "@/media/file-type";
import {
isMLSupported,
@@ -22,7 +21,6 @@ import {
} from "@/new/photos/services/search/types";
import { labelForSuggestionType } from "@/new/photos/services/search/ui";
import type { LocationTag } from "@/new/photos/services/user-entity";
-import { EnteFile } from "@/new/photos/types/file";
import {
FreeFlowText,
SpaceBetweenFlex,
@@ -76,8 +74,6 @@ interface SearchBarProps {
/** Enter or exit search mode. */
setIsInSearchMode: (v: boolean) => void;
updateSearch: UpdateSearch;
- collections: Collection[];
- files: EnteFile[];
}
export type UpdateSearch = (
@@ -140,16 +136,12 @@ interface SearchInputProps {
isOpen: boolean;
setIsOpen: (value: boolean) => void;
updateSearch: UpdateSearch;
- files: EnteFile[];
- collections: Collection[];
}
const SearchInput: React.FC<SearchInputProps> = ({
isOpen,
setIsOpen,
updateSearch,
- files,
- collections,
}) => {
const appContext = useContext(AppContext);
@@ -199,8 +191,8 @@ const SearchInput: React.FC<SearchInputProps> = ({
};
const getOptions = useCallback(
- pDebounce(getAutoCompleteSuggestions(files, collections), 250),
- [files, collections],
+ pDebounce(getAutoCompleteSuggestions(), 250),
+ [],
);
const search = (selectedOption: SearchOption) => {
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 9f44530ffa..6e2dd613bd 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -1099,8 +1099,6 @@ export default function Gallery() {
isInSearchMode={isInSearchMode}
setIsInSearchMode={setIsInSearchMode}
updateSearch={updateSearch}
- collections={collections}
- files={files}
/>
)}
</NavbarBase>
@@ -1279,8 +1277,6 @@ interface NormalNavbarContentsProps {
isInSearchMode: boolean;
setIsInSearchMode: (v: boolean) => void;
updateSearch: UpdateSearch;
- collections: Collection[];
- files: EnteFile[];
}
const NormalNavbarContents: React.FC<NormalNavbarContentsProps> = ({
@@ -1289,8 +1285,6 @@ const NormalNavbarContents: React.FC<NormalNavbarContentsProps> = ({
isInSearchMode,
setIsInSearchMode,
updateSearch,
- collections,
- files,
}) => (
<>
{!isInSearchMode && <SidebarButton onClick={openSidebar} />}
@@ -1298,8 +1292,6 @@ const NormalNavbarContents: React.FC<NormalNavbarContentsProps> = ({
isInSearchMode={isInSearchMode}
setIsInSearchMode={setIsInSearchMode}
updateSearch={updateSearch}
- collections={collections}
- files={files}
/>
{!isInSearchMode && <UploadButton onClick={openUploader} />}
</>
diff --git a/web/packages/new/photos/services/search/index.ts b/web/packages/new/photos/services/search/index.ts
index 25e8b6c1d7..af0dca4a23 100644
--- a/web/packages/new/photos/services/search/index.ts
+++ b/web/packages/new/photos/services/search/index.ts
@@ -2,11 +2,9 @@ import { isDesktop } from "@/base/app";
import log from "@/base/log";
import { masterKeyFromSession } from "@/base/session-store";
import { ComlinkWorker } from "@/base/worker/comlink-worker";
-import type { Collection } from "@/media/collection";
import { FileType } from "@/media/file-type";
import type { LocationTag } from "@/new/photos/services/user-entity";
import i18n, { t } from "i18next";
-import type { EnteFile } from "../../types/file";
import { clipMatches, isMLEnabled } from "../ml";
import type {
City,
@@ -166,12 +164,9 @@ const labelledFileTypes = (): LabelledFileType[] => [
// Suggestions shown in the search dropdown when the user has typed something.
export const getAutoCompleteSuggestions =
- (files: EnteFile[], collections: Collection[]) =>
+ () =>
async (searchPhrase: string): Promise<SearchOption[]> => {
- log.debug(() => [
- "getAutoCompleteSuggestions",
- { searchPhrase, files, collections },
- ]);
+ log.debug(() => ["getAutoCompleteSuggestions"]);
try {
const suggestions: Suggestion[] =
await suggestionsForString(searchPhrase);