Skip to content

Commit

Permalink
rerun search when sort changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PartyWumpus authored Oct 15, 2023
1 parent ca5d3ed commit 0d05d67
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/src/components/store/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,20 @@ const BrowseTab: FC<{ children: { setPluginCount: Dispatch<SetStateAction<Number
let sort = null
let direction = null
switch (selectedSort) {
case 1: direction=SortDirections.ascending; sort=SortOptions.name
case 2: direction=SortDirections.descending;sort=SortOptions.name
case 3: direction=SortDirections.ascending; sort=SortOptions.date
case 4: direction=SortDirections.descending;sort=SortOptions.date
case 1: direction=SortDirections.ascending; sort=SortOptions.name
case 2: direction=SortDirections.descending; sort=SortOptions.name
case 3: direction=SortDirections.ascending; sort=SortOptions.date
case 4: direction=SortDirections.descending; sort=SortOptions.date
}
const res = await getPluginList(sort, direction);
logger.log('got data!', res);
setPluginList(res);
data.children.setPluginCount(res.length)
})();
}, [selectedSort]);

useEffect(() => {
(async () => {
const storeRes = await getStore();
logger.log(`store is ${storeRes}, isTesting is ${storeRes === Store.Testing}`);
setIsTesting(storeRes === Store.Testing);
Expand Down

0 comments on commit 0d05d67

Please sign in to comment.