Skip to content

Commit

Permalink
chore: review
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed Oct 10, 2024
1 parent 92b302b commit e58e40e
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ const useMainPageStatus = ({

const useSelectorMainPage = () =>
useSelector(
({ currentSelections, activePage }) => ({
({ currentSelections, activePage, workingListsTemplates, workingListsContext }) => ({
categories: currentSelections.categories,
selectedCategories: currentSelections.categoriesMeta,
reduxSelectedTemplateId: workingListsTemplates.teiList?.selectedTemplateId,
workingListProgramId: workingListsContext.teiList?.programIdView,
ready: !activePage.isLoading && !activePage.lockedSelectorLoads,
error: activePage.selectionsError && activePage.selectionsError.error,
}),
Expand Down Expand Up @@ -103,6 +105,8 @@ const MainPageContainer = () => {
const {
categories,
selectedCategories,
reduxSelectedTemplateId,
workingListProgramId,
error,
ready,
} = useSelectorMainPage();
Expand All @@ -120,14 +124,6 @@ const MainPageContainer = () => {
showAllAccessible,
categoryOptionIsInvalidForOrgUnit,
});
const reduxSelectedTemplateId
= useSelector(({ workingListsTemplates }) => workingListsTemplates.teiList?.selectedTemplateId);
const workingListProgramId = useSelector(({ workingLists }) => workingLists
.teiList
?.currentRequest
?.queryParams
?.program,
);

const {
onChangeTemplate,
Expand Down

0 comments on commit e58e40e

Please sign in to comment.