File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { isEnabled } from '@automattic/calypso-config' ;
2
2
import { HOSTING_LP_FLOW , ONBOARDING_FLOW , ONBOARDING_GUIDED_FLOW } from '@automattic/onboarding' ;
3
3
import { translate } from 'i18n-calypso' ;
4
+ import { savePreference } from 'calypso/state/preferences/actions' ;
5
+ import { READER_AS_LANDING_PAGE_PREFERENCE } from 'calypso/state/sites/selectors/has-reader-as-landing-page' ;
4
6
5
7
const noop = ( ) => { } ;
6
8
@@ -90,6 +92,14 @@ export function generateFlows( {
90
92
providesDependenciesInQuery : [ 'toStepper' ] ,
91
93
optionalDependenciesInQuery : [ 'toStepper' ] ,
92
94
hideProgressIndicator : true ,
95
+ postCompleteCallback : async ( { dispatch } ) => {
96
+ dispatch (
97
+ savePreference ( READER_AS_LANDING_PAGE_PREFERENCE , {
98
+ useReaderAsLandingPage : true ,
99
+ updatedAt : Date . now ( ) ,
100
+ } )
101
+ ) ;
102
+ } ,
93
103
} ,
94
104
{
95
105
name : 'business' ,
@@ -372,6 +382,14 @@ export function generateFlows( {
372
382
lastModified : '2025-01-28' ,
373
383
showRecaptcha : true ,
374
384
hideProgressIndicator : true ,
385
+ postCompleteCallback : async ( { dispatch } ) => {
386
+ dispatch (
387
+ savePreference ( READER_AS_LANDING_PAGE_PREFERENCE , {
388
+ useReaderAsLandingPage : true ,
389
+ updatedAt : Date . now ( ) ,
390
+ } )
391
+ ) ;
392
+ } ,
375
393
} ,
376
394
{
377
395
name : 'crowdsignal' ,
Original file line number Diff line number Diff line change @@ -395,7 +395,11 @@ class Signup extends Component {
395
395
396
396
if ( flow . postCompleteCallback ) {
397
397
const siteId = dependencies && dependencies . siteId ;
398
- await flow . postCompleteCallback ( { siteId, flowName : this . props . flowName } ) ;
398
+ await flow . postCompleteCallback ( {
399
+ siteId,
400
+ flowName : this . props . flowName ,
401
+ dispatch : this . props . dispatch ,
402
+ } ) ;
399
403
}
400
404
} ;
401
405
@@ -631,7 +635,7 @@ class Signup extends Component {
631
635
dependencies . oauth2_client_id && ! progress ?. [ 'oauth2-user' ] ?. service ; // service is set for social signup (e.g. Google, Apple)
632
636
// If the user is not logged in, we need to log them in first.
633
637
// And if it's regular oauth client signup, we perform the oauth login because the WPCC user creation code automatically logs the user in.
634
- // There’ s no need to turn the bearer token into a cookie. If we log user in again, it will cause an activation error.
638
+ // There' s no need to turn the bearer token into a cookie. If we log user in again, it will cause an activation error.
635
639
// However, we need to skip this to perform a regular login for social sign in.
636
640
if ( ! userIsLoggedIn && ( config . isEnabled ( 'oauth' ) || isRegularOauth2ClientSignup ) ) {
637
641
debug ( `Handling oauth login` ) ;
@@ -1012,9 +1016,10 @@ export default connect(
1012
1016
hostingFlow,
1013
1017
} ;
1014
1018
} ,
1015
- {
1019
+ ( dispatch ) => ( {
1020
+ dispatch,
1016
1021
submitSignupStep,
1017
1022
removeStep,
1018
1023
addStep,
1019
- }
1024
+ } )
1020
1025
) ( Signup ) ;
You can’t perform that action at this time.
0 commit comments