Skip to content

Commit

Permalink
Merge 2827eb3 into bc68346
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Jun 27, 2018
2 parents bc68346 + 2827eb3 commit 662fe0d
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions source/js/components/petition/petition.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import ReactGA from 'react-ga';
import classNames from 'classnames';
import basketSignup from '../../basket-signup.js';
import SALESFORCE_COUNTRY_LIST from './salesforce-country-list.js';

class FloatingLabelInput extends React.Component {
Expand Down Expand Up @@ -57,7 +56,6 @@ export default class Petition extends React.Component {
// ten+ functions is kind of silly. The code should already
// guarantee the correct `this` will be used.
this.submitDataToApi = this.submitDataToApi.bind(this);
this.signUpToBasket = this.signUpToBasket.bind(this);
this.processFormData = this.processFormData.bind(this);

this.apiSubmissionSuccessful = this.apiSubmissionSuccessful.bind(this);
Expand Down Expand Up @@ -261,31 +259,6 @@ export default class Petition extends React.Component {
});
}

/**
* sign the user up for the mozilla newsletter.
*
* @returns {promise} the result the XHR post attempt.
*/
signUpToBasket() {
this.setState({ basketSubmitted: true });

return new Promise((resolve, reject) => {
if(this.email.element.value && this.refs.privacy.checked){
if(this.refs.newsletterSignup.checked) {
basketSignup({
email: this.email.element.value,
privacy: this.refs.privacy.checked,
newsletter: this.props.newsletter
}, resolve, reject);
} else {
resolve();
}
} else {
reject();
}
});
}

/**
* kick off the form processing when the user hits "submit".
*
Expand Down Expand Up @@ -314,9 +287,6 @@ export default class Petition extends React.Component {
this.submitDataToApi()
.then(() => {
this.apiSubmissionSuccessful();
this.signUpToBasket()
.then(this.basketSubmissionSuccessful)
.catch(this.basketSubmissionFailure);
})
.catch(this.apiSubmissionFailure);
}
Expand Down

0 comments on commit 662fe0d

Please sign in to comment.