Skip to content

Commit bc57088

Browse files
committed
Improve onboarding UI
1 parent b9c045e commit bc57088

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

web/lib/util/signup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import { getProfileRow } from 'common/love/profile'
55

66
export const signupThenMaybeRedirectToSignup = async () => {
77
const creds = await firebaseLogin()
8-
await Router.push('/')
98
const userId = creds?.user.uid
109
if (userId) {
1110
const profile = await getProfileRow(userId, db)
12-
if (!profile) {
11+
if (profile) {
12+
await Router.push('/')
13+
} else {
1314
await Router.push('/signup')
1415
}
1516
}

web/pages/register.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ function RegisterComponent() {
4444
if (user) {
4545
const profile = await getProfileRow(user.id, db)
4646
if (profile) {
47+
console.log("Router.push('/')")
4748
await Router.push('/')
4849
} else {
50+
console.log("Router.push('/signup')")
4951
await Router.push('/signup')
5052
}
5153
setIsLoading(false);

web/pages/signup.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,14 @@ export default function SignupPage() {
8484
}
8585

8686
if (user === null && !holdLoading) {
87-
router.push('/')
87+
console.log('user === null && !holdLoading')
88+
return <CompassLoadingIndicator/>
8889
}
8990

9091
return (
9192
<Col className="items-center">
9293
{!user ? (
93-
<LovePage trackPageView={'register'}><CompassLoadingIndicator/></LovePage>
94+
<CompassLoadingIndicator/>
9495
) : (
9596
<Col className={'w-full max-w-2xl px-6 py-4'}>
9697
{step === 0 ? (
@@ -131,7 +132,7 @@ export default function SignupPage() {
131132
}}
132133
/>
133134
) : step === 1 ? (
134-
<></>
135+
<CompassLoadingIndicator/>
135136
) : (
136137
<CompassLoadingIndicator/>
137138
)}

0 commit comments

Comments
 (0)