diff --git a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/PaymentPlanDetails/PaymentPlanDetailsHeader.tsx b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/PaymentPlanDetails/PaymentPlanDetailsHeader.tsx index 68a3a5e413..f21cff707c 100644 --- a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/PaymentPlanDetails/PaymentPlanDetailsHeader.tsx +++ b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/PaymentPlanDetails/PaymentPlanDetailsHeader.tsx @@ -35,7 +35,7 @@ export const PaymentPlanDetailsHeader = ({ const { t } = useTranslation(); const { businessArea, programId } = useBaseUrl(); const programCycleId = paymentPlan.programCycle?.id; - const { data: programCycleData, isLoading: isLoadingProgramCycle } = useQuery( + const { data: programCycleData } = useQuery( { queryKey: [ 'programCyclesDetails', @@ -54,12 +54,6 @@ export const PaymentPlanDetailsHeader = ({ }, ); - if (isLoadingProgramCycle) { - return null; - } - - if (!programCycleData) return null; - const breadCrumbsItems: BreadCrumbsItem[] = []; if (programCycleId) { @@ -68,7 +62,7 @@ export const PaymentPlanDetailsHeader = ({ to: '../../..', }); breadCrumbsItems.push({ - title: `${programCycleData.title}`, + title: `${programCycleData?.title || ''}`, to: '../..', }); } else { diff --git a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx index 97c2a8fa50..10cdb83bba 100644 --- a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx +++ b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx @@ -36,7 +36,7 @@ export const ProgramCyclePage = (): ReactElement => { if (permissions === null) return null; if (!selectedProgram) return null; - if (!hasPermissions(PERMISSIONS.PM_VIEW_LIST, permissions)) + if (!hasPermissions(PERMISSIONS.PM_PROGRAMME_CYCLE_VIEW_LIST, permissions)) return ; return (