PR change: refactored

This commit is contained in:
Muhsin Shah 2023-12-06 18:57:46 +05:30
parent 3734e6fc00
commit 8bb26f27a1

View file

@ -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 !== '');