mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
21 lines
485 B
TypeScript
21 lines
485 B
TypeScript
'use client';
|
|
import { useEffect } from 'react';
|
|
import { redirect } from 'next/navigation';
|
|
import { getItem, removeItem } from '@/lib/storage';
|
|
import { LAST_TEAM_CONFIG } from '@/lib/constants';
|
|
|
|
export default function RootPage() {
|
|
useEffect(() => {
|
|
const lastTeam = getItem(LAST_TEAM_CONFIG);
|
|
|
|
if (lastTeam) {
|
|
redirect(`/teams/${lastTeam}/websites`);
|
|
} else {
|
|
removeItem(LAST_TEAM_CONFIG);
|
|
|
|
redirect(`/websites`);
|
|
}
|
|
}, []);
|
|
|
|
return null;
|
|
}
|