Skip to content

Commit

Permalink
fix - clear form on exchange when we change accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyncee59 committed Jun 12, 2018
1 parent ed4ae30 commit 90b7b9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -56,7 +56,7 @@ class NumberBoxDebounced extends React.Component {
clearTimeout(this.timeout)
this.timeout = setTimeout(() => {
this.props.input.onChange(value)
}, 2000)
}, 500)
}

handleBlur () {
Expand Down
Expand Up @@ -101,7 +101,6 @@ export default ({ api, coreSagas }) => {
case 'targetAmount': yield call(changeAmount, field); break
case 'targetFiat': yield call(changeAmount, field); break
}
yield call(validateForm)
} catch (e) {
yield put(actions.logs.logErrorMessage(logLocation, 'change', e))
}
Expand All @@ -117,7 +116,7 @@ export default ({ api, coreSagas }) => {
const newTarget = yield call(selectOtherAccount, targetCoin)
yield put(actions.form.change2('exchange', 'target', newTarget))
}
yield call(changeAmount)
yield call(resetForm)
}

const changeTarget = function * () {
Expand All @@ -130,7 +129,7 @@ export default ({ api, coreSagas }) => {
const newSource = yield call(selectOtherAccount, sourceCoin)
yield put(actions.form.change2('exchange', 'source', newSource))
}
yield call(changeAmount)
yield call(resetForm)
}

const changeAmount = function * (type) {
Expand All @@ -140,6 +139,7 @@ export default ({ api, coreSagas }) => {
yield put(actions.form.change2('exchange', 'sourceFiat', sourceFiat))
yield put(actions.form.change2('exchange', 'targetAmount', targetAmount))
yield put(actions.form.change2('exchange', 'targetFiat', targetFiat))
yield call(validateForm)
yield put(A.firstStepEnabled())
}

Expand Down

0 comments on commit 90b7b9f

Please sign in to comment.