'use client' import { useRouter } from "next/navigation" import { useEffect } from "react" import { useAsyncEffect } from 'use-async-effect' import { useShallow } from 'zustand/react/shallow' import { UserResponse } from './client/response' import { useCurrentAuthenticatedUserStore, UserActions } from './providers' export default function Home() { const authenticatedUserStore: UserResponse & UserActions = useCurrentAuthenticatedUserStore(useShallow((state) => ({ ...state }))) useAsyncEffect(async () => { if(authenticatedUserStore.Id === -1) { await authenticatedUserStore.sync() } }) const router = useRouter() useEffect(() => { router.push('/orders/0/0') }, [router]) return (