This commit is contained in:
David Nguyen
2025-02-06 11:54:54 +11:00
parent 738201eb55
commit d164b90aa3
20 changed files with 57 additions and 58 deletions

View File

@ -85,12 +85,12 @@ export const MenuSwitcher = ({ user, teams: initialTeamsData }: MenuSwitcherProp
* seemlessly between teams and personal accounts.
*/
const formatRedirectUrlOnSwitch = (teamUrl?: string) => {
const baseUrl = teamUrl ? `/t/${teamUrl}/` : '/';
const baseUrl = teamUrl ? `/t/${teamUrl}` : '';
const currentPathname = (pathname ?? '/').replace(TEAM_URL_REGEX, '');
if (currentPathname === '/templates') {
return `${baseUrl}templates`;
return `${baseUrl}/templates`;
}
return baseUrl;