Skip to content

Commit

Permalink
Signup: Provide reduxStore through parameter instead of context
Browse files Browse the repository at this point in the history
  • Loading branch information
drewblaisdell committed Feb 27, 2017
1 parent 97ba93b commit db3f7ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions client/lib/signup/flow-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ assign( SignupFlowController.prototype, {

SignupActions.processSignupStep( step );

const apiFunction = steps[ step.stepName ].apiRequestFunction.bind( this );
const apiFunction = steps[ step.stepName ].apiRequestFunction;

apiFunction( ( errors, providedDependencies ) => {
this._processingSteps[ step.stepName ] = false;
SignupActions.processedSignupStep( step, errors, providedDependencies );
}, dependenciesFound, step );
}, dependenciesFound, step, this._reduxStore );
}
},

Expand Down
18 changes: 9 additions & 9 deletions client/lib/signup/step-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { getSiteTitle } from 'state/signup/steps/site-title/selectors';
import { getSurveyVertical, getSurveySiteType } from 'state/signup/steps/survey/selectors';

function createCart( callback, dependencies, data ) {
function createCart( callback, dependencies, data, reduxStore ) {
const { designType } = dependencies;
const { domainItem, themeItem } = data;

Expand All @@ -43,7 +43,7 @@ function createCart( callback, dependencies, data ) {

SignupCart.addToCart( cartKey, [ domainItem ], error => callback( error, providedDependencies ) );
} else {
createSiteWithCart( callback, dependencies, data );
createSiteWithCart( callback, dependencies, data, reduxStore );
}
}

Expand All @@ -55,9 +55,9 @@ function createSiteWithCart( callback, dependencies, {
siteUrl,
themeSlugWithRepo,
themeItem
} ) {
const siteTitle = getSiteTitle( this._reduxStore.getState() ).trim();
const surveyVertical = getSurveyVertical( this._reduxStore.getState() ).trim();
}, reduxStore ) {
const siteTitle = getSiteTitle( reduxStore.getState() ).trim();
const surveyVertical = getSurveyVertical( reduxStore.getState() ).trim();

wpcom.undocumented().sitesNew( {
blog_name: siteUrl,
Expand Down Expand Up @@ -109,7 +109,7 @@ function createSiteWithCart( callback, dependencies, {
if ( ! user.get() && isFreeThemePreselected ) {
setThemeOnSite( addToCartAndProceed, { siteSlug, themeSlugWithRepo } );
} else if ( user.get() && isFreeThemePreselected ) {
fetchSitesAndUser( siteSlug, setThemeOnSite.bind( this, addToCartAndProceed, { siteSlug, themeSlugWithRepo } ) );
fetchSitesAndUser( siteSlug, setThemeOnSite.bind( null, addToCartAndProceed, { siteSlug, themeSlugWithRepo } ) );
} else if ( user.get() ) {
fetchSitesAndUser( siteSlug, addToCartAndProceed );
} else {
Expand Down Expand Up @@ -266,9 +266,9 @@ module.exports = {
SignupCart.addToCart( siteId, newCartItems, callback );
},

createAccount( callback, dependencies, { userData, flowName, queryArgs } ) {
const surveyVertical = getSurveyVertical( this._reduxStore.getState() ).trim();
const surveySiteType = getSurveySiteType( this._reduxStore.getState() ).trim();
createAccount( callback, dependencies, { userData, flowName, queryArgs }, reduxStore ) {
const surveyVertical = getSurveyVertical( reduxStore.getState() ).trim();
const surveySiteType = getSurveySiteType( reduxStore.getState() ).trim();

wpcom.undocumented().usersNew( assign(
{}, userData, {
Expand Down

0 comments on commit db3f7ac

Please sign in to comment.