This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 1 file changed +18
-10
lines changed
1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
- import _ from ' lodash' ;
1
+ import _ from " lodash" ;
2
2
import moment from "moment" ;
3
3
import config from "../../config" ;
4
4
@@ -57,21 +57,29 @@ export const businessLogin = () => {
57
57
*/
58
58
export function checkOnboarding ( resp ) {
59
59
if ( resp ?. data . length === 0 ) {
60
- // return "/onboard/";
61
- return false ;
60
+ return "/onboard/" ;
62
61
}
63
62
64
63
const onboardingChecklistTrait = resp ?. data . filter (
65
64
( item ) => item . traitId === "onboarding_checklist"
66
65
) [ 0 ] . traits ;
67
66
68
- // // Check if onboarding flow needs to be skipped
69
- // if (
70
- // onboardingChecklistTrait.data[0].skip_onboarding &&
71
- // onboardingChecklistTrait.data[0].skip_onboarding.value === true
72
- // ) {
73
- // return false;
74
- // }
67
+ // Check if onboarding flow needs to be skipped
68
+ // 1. if the trait onboarding_wizard has a valid value for status.
69
+ // possible values of status are [seeen, completed]. Since we only want to show
70
+ // the onboarding wizard to users who haven't at least once seen the wizard
71
+ // it is sufficient to check for a non null value.
72
+ // 2. if the trait onboarding_wizard has a truthy value for skip.
73
+
74
+ for ( let checklistTrait of onboardingChecklistTrait . data ) {
75
+ if (
76
+ checklistTrait . onboarding_wizard != null &&
77
+ ( checklistTrait . onboarding_wizard . status != null ||
78
+ checklistTrait . onboarding_wizard . skip )
79
+ ) {
80
+ return false ;
81
+ }
82
+ }
75
83
76
84
const profileCompletedData =
77
85
onboardingChecklistTrait . data [ 0 ] . profile_completed ;
You can’t perform that action at this time.
0 commit comments