diff --git a/web/hooks/use-user.ts b/web/hooks/use-user.ts index a0954218..ffa5abba 100644 --- a/web/hooks/use-user.ts +++ b/web/hooks/use-user.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react' import { listenForLogin, listenForUser, User } from '../lib/firebase/users' export const useUser = () => { - const [user, setUser] = useState(null) + const [user, setUser] = useState(undefined) useEffect(() => listenForLogin(setUser), []) const userId = user?.id diff --git a/web/pages/[username]/[contractId].tsx b/web/pages/[username]/[contractId].tsx index b6057dd5..aec7d641 100644 --- a/web/pages/[username]/[contractId].tsx +++ b/web/pages/[username]/[contractId].tsx @@ -64,7 +64,7 @@ export default function ContractPage() { )} - + ) } diff --git a/web/pages/create.tsx b/web/pages/create.tsx index b4d7b44c..cd656240 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -13,7 +13,7 @@ export default function NewContract() { const creator = useUser() useEffect(() => { - if (!creator) router.push('/') + if (creator === null) router.push('/') }) const [initialProb, setInitialProb] = useState(50)