diff --git a/pages/Unlock.tsx b/pages/Unlock.tsx index 9c1503b..e05766e 100644 --- a/pages/Unlock.tsx +++ b/pages/Unlock.tsx @@ -10,6 +10,8 @@ import { useSession } from "~/hooks/useSession"; export function Unlock() { const [isUnlocking, setIsUnlocking] = React.useState(false); + const [isAutoPrompted, setIsAutoPrompted] = React.useState(false); + const { signIn } = useSession(); const handleUnlock = useCallback(async () => { @@ -36,6 +38,13 @@ export function Unlock() { } }, [isUnlocking, signIn]); + React.useEffect(() => { + if (!isAutoPrompted) { + handleUnlock(); + } + setIsAutoPrompted(true); + }, [isAutoPrompted, handleUnlock]); + return (