From 8bb26f27a1c7a1edf1e5cbbf5baa3a695da40a73 Mon Sep 17 00:00:00 2001 From: Muhsin Shah Date: Wed, 6 Dec 2023 18:57:46 +0530 Subject: [PATCH] PR change: refactored --- frontend/src/_helpers/routes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 !== '');