@@ -16,7 +16,7 @@ import ProductSelector from './ProductSelector';
16
16
import { SimpleSiteAuthenticator } from './SimpleSiteAuthenticator' ;
17
17
import { AtlascodeErrorBoundary } from '../common/ErrorBoundary' ;
18
18
import { AnalyticsView } from '../../../analyticsTypes' ;
19
- import { Experiments , Features } from '../../../util/featureFlags' ;
19
+ import { Experiments } from '../../../util/featureFlags' ;
20
20
import { CommonMessageType } from '../../../lib/ipc/toUI/common' ;
21
21
import { OnboardingActionType } from '../../../lib/ipc/fromUI/onboarding' ;
22
22
import { JiraOnboarding } from './JiraOnboarding' ;
@@ -60,7 +60,7 @@ export const OnboardingPage: React.FunctionComponent = () => {
60
60
const [ state , controller ] = useOnboardingController ( ) ;
61
61
const { authDialogController, authDialogOpen, authDialogProduct, authDialogEntry } = useAuthDialog ( ) ;
62
62
const [ activeStep , setActiveStep ] = React . useState ( 0 ) ;
63
- const [ authExpEnabled , setAuthExpEnabled ] = React . useState ( false ) ;
63
+ // const [authExpEnabled, setAuthExpEnabled] = React.useState(false);
64
64
const [ useAuthUI , setUseAuthUI ] = React . useState ( false ) ;
65
65
const [ jiraSignInText , setJiraSignInText ] = useState ( 'Sign In to Jira Cloud' ) ;
66
66
const [ bitbucketSignInText , setBitbucketSignInText ] = useState ( 'Sign In to Bitbucket Cloud' ) ;
@@ -70,15 +70,14 @@ export const OnboardingPage: React.FunctionComponent = () => {
70
70
React . useEffect ( ( ) => {
71
71
window . addEventListener ( 'message' , ( event ) => {
72
72
const message = event . data ;
73
- if ( message . command === CommonMessageType . UpdateFeatureFlags ) {
74
- const featureValue = message . featureFlags [ Features . EnableAuthUI ] ;
75
- setAuthExpEnabled ( featureValue ) ;
76
- } else if ( message . command === CommonMessageType . UpdateExperimentValues ) {
73
+ if ( message . command === CommonMessageType . UpdateExperimentValues ) {
77
74
const experimentValue = message . experimentValues [ Experiments . NewAuthUI ] ;
78
- setUseAuthUI ( authExpEnabled && experimentValue === 'new' ) ;
75
+ if ( typeof experimentValue === 'string' && experimentValue !== undefined && experimentValue !== null ) {
76
+ setUseAuthUI ( experimentValue === 'new' ) ;
77
+ }
79
78
}
80
79
} ) ;
81
- } , [ authExpEnabled , controller ] ) ;
80
+ } , [ controller ] ) ;
82
81
function getSteps ( ) {
83
82
if ( useAuthUI ) {
84
83
return [ 'Setup Jira' , 'Setup BitBucket' , 'Explore' ] ;
0 commit comments