Skip to content

Commit ffae20b

Browse files
authored
Merge pull request #706 from newfold-labs/update/remove-DIY-onboarding-from-fork
Hide DIY onboarding from the fork step
2 parents 5d42ea3 + 2d80b6f commit ffae20b

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

src/OnboardingSPA/steps/TheFork/index.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,22 @@ const TheFork = () => {
7070
} );
7171

7272
const handleExperimentVersion = async () => {
73-
let theForkExperimentVersion = 0;
74-
if ( currentData.sitegen.theForkExperimentVersion !== 0 ) {
75-
// Use an existing experiment version if it exists
76-
setExperimentVersion(
77-
currentData.sitegen.theForkExperimentVersion
78-
);
79-
theForkExperimentVersion =
80-
currentData.sitegen.theForkExperimentVersion;
81-
} else {
82-
// Generate a random experiment version either 1 or 2
83-
theForkExperimentVersion = Math.floor( Math.random() * 2 ) + 1;
84-
setExperimentVersion( theForkExperimentVersion );
73+
// setting the experiment version to 2 so that DIY onboarding is always hidden
74+
const theForkExperimentVersion = 2;
75+
setExperimentVersion( theForkExperimentVersion );
8576

77+
// the default value of theForkExperimentVersion while initialising the store is 0
78+
if ( currentData.sitegen.theForkExperimentVersion === 0 ) {
8679
// Sync that to the store and DB for same version on refresh
87-
currentData.sitegen.theForkExperimentVersion =
88-
theForkExperimentVersion;
80+
currentData.sitegen.theForkExperimentVersion = theForkExperimentVersion;
8981
setCurrentOnboardingData( currentData );
9082
await setFlow( currentData );
91-
const experimentVersionNames = {
92-
1: 'control',
93-
2: 'hidden',
94-
};
9583

9684
// Send an event for the experiment version shown to the user.
9785
sendOnboardingEvent(
9886
new OnboardingEvent(
9987
ACTION_SITEGEN_FORK_AI_EXPERIMENT,
100-
experimentVersionNames[ theForkExperimentVersion ],
88+
'hidden', // this event shows that the DIY onboarding was not shown
10189
null,
10290
null,
10391
CATEGORY_EXPERIMENT

0 commit comments

Comments
 (0)