Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #944 from egovernments/ISTE-455
Browse files Browse the repository at this point in the history
Iste-455: Deactivate all the web links regard to citizens
  • Loading branch information
pradeepkumarcm-egov authored Sep 12, 2024
2 parents e5eec50 + c4c86ff commit 8d1ce01
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CitizenApp from "./pages/citizen";
import EmployeeApp from "./pages/employee";
import CommonApp from "./pages/common";

export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, defaultLanding = "citizen" }) => {
export const DigitApp = ({ stateCode, modules, appTenants, logoUrl, initData, defaultLanding = "employee" }) => {
const history = useHistory();
const { pathname } = useLocation();
const innerWidth = window.innerWidth;
Expand Down 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`}>
<CitizenApp {...commonProps} />
{shouldRedirectToEmployee() ? <Redirect to={`/${window?.contextPath}/employee`} /> : <CitizenApp {...commonProps} />}
</Route>
<Route path={`/${window?.contextPath}/common`}>
<CommonApp {...commonProps} />
Expand Down

0 comments on commit 8d1ce01

Please sign in to comment.