@@ -2300,11 +2300,7 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {
2300
2300
boolean isFreeWPCom = mSite .isWPCom () && SiteUtils .onFreePlan (mSite );
2301
2301
boolean isWPComSite = mSite .isWPCom () || mSite .isWPComAtomic ();
2302
2302
2303
- int hashedUserId = convertUserIdToHash (getUserId (), "can_view_editor_onboarding" );
2304
- boolean canViewEditorOnboarding = !AppPrefs .hasLaunchedGutenbergEditor () && (
2305
- hashedUserId % 100 >= (100 - EDITOR_ONBOARDING_PHASE_PERCENTAGE )
2306
- || BuildConfig .DEBUG
2307
- );
2303
+ boolean enableEditorOnboarding = !AppPrefs .hasLaunchedGutenbergEditor () && canViewEditorOnboarding ();
2308
2304
2309
2305
return new GutenbergPropsBuilder (
2310
2306
mContactInfoBlockFeatureConfig .isEnabled () && SiteUtils .supportsContactInfoFeature (mSite ),
@@ -2328,21 +2324,19 @@ private GutenbergPropsBuilder getGutenbergPropsBuilder() {
2328
2324
* Temporary method for the Editor Onboarding project to control the percentage
2329
2325
* of users able to use this new editor onboarding tooltip feature. This will eventually
2330
2326
* be removed when the functionality is opened to all users.
2331
- *
2332
- * If the currently logged in user is a WPcom user, then return the userId associated with
2333
- * that account. If logged in via self-hosted admin creds then this value will be '0'. In this
2334
- * case we use the anonymous ID generated by Tracks saved in SharedPrefs.
2335
- *
2336
- * @return A unique ID for the logged in user
2337
2327
*/
2338
- private String getUserId () {
2328
+ private boolean canViewEditorOnboarding () {
2329
+ // Get the userId for the logged in user. If not WPcom, use the anonymous userId
2330
+ // generated by tracks.
2339
2331
long userAccountId = mAccountStore .getAccount ().getUserId ();
2340
2332
String userId = String .valueOf (userAccountId );
2341
2333
if (userAccountId == 0 ) {
2342
2334
SharedPreferences preferences = PreferenceManager .getDefaultSharedPreferences (getApplicationContext ());
2343
2335
userId = preferences .getString ("nosara_tracks_anon_id" , null );
2344
2336
}
2345
- return userId ;
2337
+
2338
+ int hashedUserId = convertUserIdToHash (userId , "can_view_editor_onboarding" );
2339
+ return hashedUserId % 100 >= (100 - EDITOR_ONBOARDING_PHASE_PERCENTAGE ) || BuildConfig .DEBUG ;
2346
2340
}
2347
2341
2348
2342
/**
0 commit comments