From bc5708857a4faf18c1339e33707bea877573157c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 16 Oct 2025 14:37:17 +0200 Subject: [PATCH] Improve onboarding UI --- web/lib/util/signup.ts | 5 +++-- web/pages/register.tsx | 2 ++ web/pages/signup.tsx | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/web/lib/util/signup.ts b/web/lib/util/signup.ts index 8dfdbe0a..7bffe923 100644 --- a/web/lib/util/signup.ts +++ b/web/lib/util/signup.ts @@ -5,11 +5,12 @@ import { getProfileRow } from 'common/love/profile' export const signupThenMaybeRedirectToSignup = async () => { const creds = await firebaseLogin() - await Router.push('/') const userId = creds?.user.uid if (userId) { const profile = await getProfileRow(userId, db) - if (!profile) { + if (profile) { + await Router.push('/') + } else { await Router.push('/signup') } } diff --git a/web/pages/register.tsx b/web/pages/register.tsx index 9d8ec9fb..095f326d 100644 --- a/web/pages/register.tsx +++ b/web/pages/register.tsx @@ -44,8 +44,10 @@ function RegisterComponent() { if (user) { const profile = await getProfileRow(user.id, db) if (profile) { + console.log("Router.push('/')") await Router.push('/') } else { + console.log("Router.push('/signup')") await Router.push('/signup') } setIsLoading(false); diff --git a/web/pages/signup.tsx b/web/pages/signup.tsx index aeebb89a..45973f01 100644 --- a/web/pages/signup.tsx +++ b/web/pages/signup.tsx @@ -84,13 +84,14 @@ export default function SignupPage() { } if (user === null && !holdLoading) { - router.push('/') + console.log('user === null && !holdLoading') + return } return ( {!user ? ( - + ) : ( {step === 0 ? ( @@ -131,7 +132,7 @@ export default function SignupPage() { }} /> ) : step === 1 ? ( - <> + ) : ( )}