Should not redirect if already on the right team.

This commit is contained in:
Mike Cao 2024-11-27 22:37:47 -08:00
parent 4af275a7ab
commit c6fd20974d

View File

@ -86,12 +86,10 @@ export function NavBar() {
if (!cloudMode) { if (!cloudMode) {
const teamIdLocal = getItem('umami.team')?.id; const teamIdLocal = getItem('umami.team')?.id;
if (teamIdLocal && pathname !== '/' && pathname !== '/dashboard') { if (teamIdLocal && teamIdLocal !== teamId) {
const url = '/'; router.push(
router.push(url); pathname !== '/' && pathname !== '/dashboard' ? '/' : `/teams/${teamIdLocal}/dashboard`,
} else if (teamIdLocal) { );
const url = `/teams/${teamIdLocal}/dashboard`;
router.push(url);
} }
} }
}, [cloudMode]); }, [cloudMode]);