diff --git a/frontend/src/_helpers/routes.js b/frontend/src/_helpers/routes.js index e8611d46ea..3c4de8c2ea 100644 --- a/frontend/src/_helpers/routes.js +++ b/frontend/src/_helpers/routes.js @@ -120,7 +120,8 @@ export const getWorkspaceIdOrSlugFromURL = () => { }; export const excludeWorkspaceIdFromURL = (pathname) => { - const tempPathname = getSubpath() ? pathname.replace(getSubpath(), '') : pathname; + const subPath = getSubpath(); + const tempPathname = subPath ? pathname.replace(subPath, '') : pathname; if (!['/integrations', '/applications/', '/switch-workspace'].find((path) => tempPathname.startsWith(path))) { pathname = tempPathname; const paths = pathname?.split('/').filter((path) => path !== '');