Skip to content

Commit

Permalink
Corrected the citizen/payment issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mukund-egov committed Sep 12, 2024
1 parent 28c247b commit c4c86ff
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,22 @@ export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, de
pathname,
initData,
};

// Do not redirect if it's a payment route under citizen
const shouldRedirectToEmployee = () => {
if (pathname.startsWith(`/${window?.contextPath}/citizen/payment`)) {
return false;
}
return true;
};

return (
<Switch>
<Route path={`/${window?.contextPath}/employee`}>
<EmployeeApp {...commonProps} />
</Route>
<Route path={`/${window?.contextPath}/citizen`}>
<Redirect to={`/${window?.contextPath}/employee`} />
{shouldRedirectToEmployee() ? <Redirect to={`/${window?.contextPath}/employee`} /> : <CitizenApp {...commonProps} />}
</Route>
<Route path={`/${window?.contextPath}/common`}>
<CommonApp {...commonProps} />
Expand Down

0 comments on commit c4c86ff

Please sign in to comment.