mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-05 17:05:46 +01:00
Removed team redirect for cloud mode.
This commit is contained in:
parent
9c2bfe8956
commit
7803f72530
@ -76,20 +76,25 @@ export function NavBar() {
|
|||||||
|
|
||||||
const handleTeamChange = (teamId: string) => {
|
const handleTeamChange = (teamId: string) => {
|
||||||
const url = teamId ? `/teams/${teamId}` : '/';
|
const url = teamId ? `/teams/${teamId}` : '/';
|
||||||
|
if (!cloudMode) {
|
||||||
setItem('umami.team', { id: teamId });
|
setItem('umami.team', { id: teamId });
|
||||||
|
}
|
||||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!cloudMode) {
|
||||||
const teamIdLocal = getItem('umami.team')?.id;
|
const teamIdLocal = getItem('umami.team')?.id;
|
||||||
|
|
||||||
if (teamIdLocal && pathname !== '/' && pathname !== '/dashboard') {
|
if (teamIdLocal && pathname !== '/' && pathname !== '/dashboard') {
|
||||||
const url = '/';
|
const url = '/';
|
||||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
router.push(url);
|
||||||
} else if (teamIdLocal) {
|
} else if (teamIdLocal) {
|
||||||
const url = `/teams/${teamIdLocal}/dashboard`;
|
const url = `/teams/${teamIdLocal}/dashboard`;
|
||||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
router.push(url);
|
||||||
}
|
}
|
||||||
}, []);
|
}
|
||||||
|
}, [cloudMode]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.navbar}>
|
<div className={styles.navbar}>
|
||||||
|
Loading…
Reference in New Issue
Block a user