Skip to content

Commit

Permalink
fix(SFOX): remove componentWillReceiveProps
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Jun 12, 2018
1 parent cd7972e commit 95b3bdd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Expand Up @@ -81,11 +81,6 @@ class AcceptTerms extends Component {
this.handleSignup = this.handleSignup.bind(this)
}

componentWillReceiveProps (nextProps) {
const error = Remote.of(nextProps.sfoxSignupStatus)
if (error.data.error && error.data.error.message === 'user is already registered') this.props.updateUI({ uniqueEmail: false })
}

handleSignup (e) {
e.preventDefault()
this.props.sfoxFrontendActions.sfoxNotAsked()
Expand All @@ -100,7 +95,7 @@ class AcceptTerms extends Component {
NotAsked: () => ({ busy: false })
})

const { invalid, email, smsNumber, editEmail, editMobile, emailVerified, smsVerified, sfoxFrontendActions } = this.props
const { invalid, email, smsNumber, editEmail, editMobile, emailVerified, smsVerified, sfoxFrontendActions, needsChangeEmail } = this.props
const { sfoxNotAsked } = sfoxFrontendActions

const faqHelper = () => helpers.map((el, i) => <Helper key={i} question={el.question} answer={el.answer} />)
Expand Down Expand Up @@ -181,7 +176,7 @@ class AcceptTerms extends Component {
<Text size='12px' color='error' weight={300} >
<FormattedMessage id='sfoxexchangedata.create.accept.error' defaultMessage='Unfortunately this email is being used for another account.' />
</Text>
<Link size='12px' weight={300} onClick={() => { sfoxNotAsked(); this.props.updateUI({ create: 'change_email' }) }} >
<Link size='12px' weight={300} onClick={() => { sfoxNotAsked(); needsChangeEmail() }} >
<FormattedMessage id='clickhere' defaultMessage='Click here' />
</Link>
<Text size='12px' weight={300} color='error'>
Expand Down
Expand Up @@ -29,6 +29,7 @@ class CreateContainer extends Component {
editMobile={() => { this.props.updateUI({ create: 'change_mobile' }); this.setState({ editVerifiedMobile: true }) }}
editVerifiedEmail={this.state.editVerifiedEmail}
editVerifiedMobile={this.state.editVerifiedMobile}
needsChangeEmail={() => this.props.updateUI({ create: 'change_email', uniqueEmail: false })}
{...this.props}
/>
}
Expand Down
16 changes: 10 additions & 6 deletions packages/blockchain-wallet-v4/src/redux/data/sfox/sagas.js
Expand Up @@ -131,12 +131,16 @@ export default ({ api, options }) => {
}

const getSfox = function * () {
const state = yield select()
const delegate = new ExchangeDelegate(state, api)
const value = yield select(buySellSelectors.getMetadata)
const walletOptions = state.walletOptionsPath.data
const sfox = sfoxService.refresh(value, delegate, walletOptions)
return sfox
try {
const state = yield select()
const delegate = new ExchangeDelegate(state, api)
const value = yield select(buySellSelectors.getMetadata)
const walletOptions = state.walletOptionsPath.data
const sfox = sfoxService.refresh(value, delegate, walletOptions)
return sfox
} catch (error) {
console.warn(error)
}
}

const setBankManually = function * (data) {
Expand Down

0 comments on commit 95b3bdd

Please sign in to comment.