refactor: onboarding user role validation (#1287)

This commit is contained in:
guru_sainath 2023-06-14 13:39:49 +05:30 committed by GitHub
parent 6f7b563712
commit 4083f623a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,10 +34,10 @@ const Onboarding: NextPage = () => {
useEffect(() => {
if (user && step === null) {
let currentStep: null | number = null;
let currentStep: number = 1;
if (user?.role) currentStep = 2;
if (user?.last_workspace_id) currentStep = 4;
if (currentStep != null) setStep(() => currentStep);
setStep(() => currentStep);
}
}, [step, user]);