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) {
const teamIdLocal = getItem('umami.team')?.id;
if (teamIdLocal && pathname !== '/' && pathname !== '/dashboard') {
const url = '/';
router.push(url);
} else if (teamIdLocal) {
const url = `/teams/${teamIdLocal}/dashboard`;
router.push(url);
if (teamIdLocal && teamIdLocal !== teamId) {
router.push(
pathname !== '/' && pathname !== '/dashboard' ? '/' : `/teams/${teamIdLocal}/dashboard`,
);
}
}
}, [cloudMode]);