mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Removed team redirect for cloud mode.
This commit is contained in:
parent
9c2bfe8956
commit
7803f72530
1 changed files with 14 additions and 9 deletions
|
|
@ -76,20 +76,25 @@ export function NavBar() {
|
|||
|
||||
const handleTeamChange = (teamId: string) => {
|
||||
const url = teamId ? `/teams/${teamId}` : '/';
|
||||
setItem('umami.team', { id: teamId });
|
||||
if (!cloudMode) {
|
||||
setItem('umami.team', { id: teamId });
|
||||
}
|
||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const teamIdLocal = getItem('umami.team')?.id;
|
||||
if (teamIdLocal && pathname !== '/' && pathname !== '/dashboard') {
|
||||
const url = '/';
|
||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
||||
} else if (teamIdLocal) {
|
||||
const url = `/teams/${teamIdLocal}/dashboard`;
|
||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
}, [cloudMode]);
|
||||
|
||||
return (
|
||||
<div className={styles.navbar}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue