Improve onboarding UI

This commit is contained in:
MartinBraquet
2025-10-16 14:37:17 +02:00
parent b9c045ebfb
commit bc5708857a
3 changed files with 9 additions and 5 deletions

View File

@@ -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')
}
}

View File

@@ -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);

View File

@@ -84,13 +84,14 @@ export default function SignupPage() {
}
if (user === null && !holdLoading) {
router.push('/')
console.log('user === null && !holdLoading')
return <CompassLoadingIndicator/>
}
return (
<Col className="items-center">
{!user ? (
<LovePage trackPageView={'register'}><CompassLoadingIndicator/></LovePage>
<CompassLoadingIndicator/>
) : (
<Col className={'w-full max-w-2xl px-6 py-4'}>
{step === 0 ? (
@@ -131,7 +132,7 @@ export default function SignupPage() {
}}
/>
) : step === 1 ? (
<></>
<CompassLoadingIndicator/>
) : (
<CompassLoadingIndicator/>
)}