From fb1f93a3c0f7ad7484b84ef71b01efe8b741e679 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Thu, 16 Mar 2023 23:59:24 -0700 Subject: [PATCH] Skip adding users if no email service --- frontend/src/pages/signup.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/signup.tsx b/frontend/src/pages/signup.tsx index 298fc9536..1f1099c7b 100644 --- a/frontend/src/pages/signup.tsx +++ b/frontend/src/pages/signup.tsx @@ -71,11 +71,17 @@ export default function SignUp() { } }; - // when email service is not configured, skip step 2 + // when email service is not configured, skip step 2 and 5 useEffect(() => { if (!serverDetails?.emailConfigured && step === 2){ incrementStep() } + + if (!serverDetails?.emailConfigured && step === 5){ + getWorkspaces().then((userWorkspaces)=>{ + router.push(`/dashboard/${userWorkspaces[0]._id}`); + }); + } }, [step]); return ( @@ -121,9 +127,7 @@ export default function SignUp() { password={password} name={`${firstName} ${lastName}`} /> - ) : ( - - )} + ) : (serverDetails?.emailConfigured ? : "")}