umami/src/app/page.tsx
Mike Cao ef3f7274e3
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
Remember last team.
2025-11-17 19:12:25 -08:00

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;
}