diff --git a/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx b/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx index 794c97606f..b9ea88639f 100644 --- a/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx +++ b/web/apps/photos/src/components/Collections/CollectionSelector/index.tsx @@ -39,7 +39,6 @@ interface Props { collections: Collection[]; collectionSummaries: CollectionSummaries; } - function CollectionSelector({ attributes, collectionSummaries, @@ -47,7 +46,7 @@ function CollectionSelector({ ...props }: Props) { const appContext = useContext(AppContext); - const [searchQuery, setSearchQuery] = useState(""); + const [collectionsToShow, setCollectionsToShow] = useState< CollectionSummary[] >([]); @@ -82,7 +81,6 @@ function CollectionSelector({ return isMoveToAllowedCollection(type); } }) - .sort((a, b) => { return a.name.localeCompare(b.name); }) @@ -91,24 +89,15 @@ function CollectionSelector({ COLLECTION_SORT_ORDER.get(a.type) - COLLECTION_SORT_ORDER.get(b.type) ); - }) - .filter((collection) => - collection.name - .toLowerCase() - .includes(searchQuery.toLowerCase()), - ); + }); if (collectionsToShow.length === 0) { - if (searchQuery !== "") { - return console.log("No Albums with that name..."); - } else { - props.onClose(); - attributes.showNextModal(); - } + props.onClose(); + attributes.showNextModal(); } setCollectionsToShow(collectionsToShow); }; main(); - }, [collectionSummaries, attributes, props.open, searchQuery]); + }, [collectionSummaries, attributes, props.open]); if (!collectionsToShow?.length) { return <>; @@ -132,12 +121,6 @@ function CollectionSelector({ props.onClose(); }; - const handleSearchInputChange = (e) => { - if (e) { - setSearchQuery(e.target.value); - } else console.log("No collections to show....."); - }; - return ( -