Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Avoid duplicate items in App Store search results
Browse files Browse the repository at this point in the history
  • Loading branch information
ayltai committed Sep 26, 2022
1 parent 7af0238 commit ed58fef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "brewmymac-frontend",
"description" : "Possibly the coolest way to install apps and customize your Mac!",
"version" : "1.1.4",
"version" : "1.1.3",
"author" : {
"name" : "Alan Tai"
},
Expand Down
34 changes: 1 addition & 33 deletions frontend/src/components/FilteredItemGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,39 +111,7 @@ export const FilteredItemGrid = ({

setFilteredItems(search());
}
}, [ filter, selectedOnly, ]);

useEffect(() => {
if (formulaStatus === QueryStatus.fulfilled && formulaData) {
searchEngine.current.addAll(formulaData);

if (filter.length >= MIN_SEARCH_LENGTH) setFilteredItems(search());
}
}, [ formulaData, formulaStatus, ]);

useEffect(() => {
if (caskStatus === QueryStatus.fulfilled && caskData) {
searchEngine.current.addAll(caskData);

if (filter.length >= MIN_SEARCH_LENGTH) setFilteredItems(search());
}
}, [ caskData, caskStatus, ]);

useEffect(() => {
if (searchStatus === QueryStatus.fulfilled && searchData) {
searchEngine.current.addAll(searchData);

if (filter.length >= MIN_SEARCH_LENGTH) setFilteredItems(search());
}
}, [ searchData, searchStatus, ]);

useEffect(() => {
if (tweakStatus === QueryStatus.fulfilled && tweakData) {
searchEngine.current.addAll(tweakData);

if (filter.length >= MIN_SEARCH_LENGTH) setFilteredItems(search());
}
}, [ tweakData, tweakStatus, ]);
}, [ caskData, filter, formulaData, searchData, selectedOnly, tweakData, ]);

useEffect(() => {
if (onStatusChange) return onStatusChange(formulaStatus === QueryStatus.pending || caskStatus === QueryStatus.pending || searchStatus === QueryStatus.pending || tweakStatus === QueryStatus.pending);
Expand Down

0 comments on commit ed58fef

Please sign in to comment.