Skip to content

Commit

Permalink
added load more for filter
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Dec 8, 2023
1 parent fec1dc4 commit 28df49b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions frontend/app/src/pages/tickets/Tickets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function BodyComponent() {
await main.getPeopleBounties({ page: 1, resetPage: true, ...checkboxIdToSelectedMap });
setLoading(false);
})();
}, [main, checkboxIdToSelectedMap]);
}, [main]);

useEffect(() => {
setCheckboxIdToSelectedMap({
Expand All @@ -53,14 +53,15 @@ function BodyComponent() {
}
}, [main, ui.meInfo]);

const onChangeStatus = (optionId: any) => {
const onChangeStatus = async (optionId: any) => {
const newCheckboxIdToSelectedMap = {
...checkboxIdToSelectedMap,
...{
[optionId]: !checkboxIdToSelectedMap[optionId]
}
};
setCheckboxIdToSelectedMap(newCheckboxIdToSelectedMap);
await main.getPeopleBounties({ page: 1, resetPage: true, ...newCheckboxIdToSelectedMap });
};

const onChangeLanguage = (optionId: any) => {
Expand Down
8 changes: 6 additions & 2 deletions frontend/app/src/people/widgetViews/WidgetSwitchViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { queryLimit } from 'store/main';
import { Spacer } from '../main/Body';
import NoResults from '../utils/NoResults';
import { uiStore } from '../../store/ui';
import { bountyHeaderFilter, bountyHeaderLanguageFilter } from '../utils/filterValidation';
import { bountyHeaderLanguageFilter } from '../utils/filterValidation';
import { colors } from '../../config/colors';
import { useStores } from '../../store';
import { widgetConfigs } from '../utils/Constants';
Expand Down Expand Up @@ -170,7 +170,11 @@ function WidgetSwitchViewer(props: any) {
setPage(currentPage);
setCurrentItems(currentItems + queryLimit);

await main.getPeopleBounties({ limit: queryLimit, page: currentPage });
await main.getPeopleBounties({
limit: queryLimit,
page: currentPage,
...props.checkboxIdToSelectedMap
});
};

const listItems =
Expand Down

0 comments on commit 28df49b

Please sign in to comment.