mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-14 01:54:40 -04:00
Improve onboarding UI
This commit is contained in:
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user