aboutsummaryrefslogtreecommitdiff
path: root/src/app/page.tsx
blob: 6f0033dff88bcf646e158230b5909695cc9238f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use client';
import { redirect } from 'next/navigation';
import { useEffect } from 'react';
import { LAST_TEAM_CONFIG } from '@/lib/constants';
import { getItem } from '@/lib/storage';

export default function RootPage() {
  useEffect(() => {
    const lastTeam = getItem(LAST_TEAM_CONFIG);

    if (lastTeam) {
      redirect(`/teams/${lastTeam}/websites`);
    } else {
      redirect(`/websites`);
    }
  }, []);

  return null;
}