Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Should not redirect if already on the right team.

Mike Caoc6fd20974d5b
diff --git a/src/app/(main)/NavBar.tsx b/src/app/(main)/NavBar.tsx
index 6daae0357..5c8bba01a 100644
--- a/src/app/(main)/NavBar.tsx
+++ b/src/app/(main)/NavBar.tsx
@@ -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]);