From effd0b6fc4fa07d9a90e25aa17b3eefa6e0d0f66 Mon Sep 17 00:00:00 2001 From: aaradhya-egov Date: Mon, 9 Sep 2024 15:17:39 +0530 Subject: [PATCH] fix --- .../core/src/pages/citizen/Home/LocationSelection.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js index d722237d0b9..5c6f698403a 100644 --- a/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js +++ b/micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/citizen/Home/LocationSelection.js @@ -15,6 +15,12 @@ if (Digit.Utils.getMultiRootTenant()) { // Call the useTenants hook only if the condition is met hookResult = Digit.Hooks.useTenants(); } +const { + data: { stateInfo, uiHomePage } = {}, + isLoading: initisLoading, +} = Digit.Hooks.useStore.getInitData(); + +const redirectURL = uiHomePage?.redirectURL; // Destructure the result const { data: cities, isLoading } = hookResult; @@ -58,9 +64,14 @@ const { data: TenantMngmtSearch, isLoading: isLoadingTenantMngmtSearch } = Digit if (selectedCity) { Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY", selectedCity); const redirectBackTo = location.state?.redirectBackTo; + if(redirectURL){ + history.push(`/${window?.contextPath}/citizen/${redirectURL}`); + } + else{ if (redirectBackTo) { history.replace(redirectBackTo); } else history.push(`/${window?.contextPath}/citizen`); + } } else { setShowError(true); }