diff --git a/micro-ui/web/sandbox/App.js b/micro-ui/web/sandbox/App.js index 2293963db5c..706ca629645 100644 --- a/micro-ui/web/sandbox/App.js +++ b/micro-ui/web/sandbox/App.js @@ -50,10 +50,12 @@ function App() { const isMultiRootTenant = window?.globalConfigs?.getConfig("MULTI_ROOT_TENANT") || false; if (isMultiRootTenant) { - const pathname = window.location.pathname; + const pathname = window.location.pathname; const context = window?.globalConfigs?.getConfig("CONTEXT_PATH"); const start = pathname.indexOf(context) + context.length + 1; - const end = pathname.indexOf("employee"); + const employeeIndex = pathname.indexOf("employee"); + const citizenIndex = pathname.indexOf("citizen"); + const end = (employeeIndex !== -1) ? employeeIndex : (citizenIndex !== -1) ? citizenIndex : -1; const tenant = end > start ? pathname.substring(start, end).replace(/\/$/, "") : ""; window.contextPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") + `${tenant ? `/${tenant}` : ""}` || "digit-ui"; window.globalPath = window?.globalConfigs?.getConfig("CONTEXT_PATH") || "digit-ui";