diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-08-29 08:37:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 08:37:13 +0800 |
commit | 9ab0354e36a1598677bf9c0f685ce60c58e5f770 (patch) | |
tree | 26a60d60efe233dbe8b6020e0dce76a629eb1483 /ui/app/components/pages | |
parent | 4560df6e739b97caf95ef5bc5bc93f91e8c890bb (diff) | |
parent | f78dc96a2c39aa8254317d57691ebd4294e7ad2d (diff) | |
download | tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar.gz tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar.bz2 tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar.lz tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar.xz tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.tar.zst tangerine-wallet-browser-9ab0354e36a1598677bf9c0f685ce60c58e5f770.zip |
Merge pull request #5155 from MetaMask/i5154-confirm-spinner
Fix infinite spinner on failed transactions
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r-- | ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js index 961aa304e..3216d01c3 100644 --- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -73,6 +73,7 @@ export default class ConfirmTransactionBase extends Component { state = { submitting: false, + submitError: null, } componentDidUpdate () { @@ -268,7 +269,7 @@ export default class ConfirmTransactionBase extends Component { return } - this.setState({ submitting: true }) + this.setState({ submitting: true, submitError: null }) if (onSubmit) { Promise.resolve(onSubmit(txData)) @@ -280,7 +281,9 @@ export default class ConfirmTransactionBase extends Component { this.setState({ submitting: false }) history.push(DEFAULT_ROUTE) }) - .catch(() => this.setState({ submitting: false })) + .catch(error => { + this.setState({ submitting: false, submitError: error.message }) + }) } } @@ -309,7 +312,7 @@ export default class ConfirmTransactionBase extends Component { nonce, warning, } = this.props - const { submitting } = this.state + const { submitting, submitError } = this.state const { name } = methodData const fiatConvertedAmount = formatCurrency(fiatTransactionAmount, currentCurrency) @@ -332,7 +335,7 @@ export default class ConfirmTransactionBase extends Component { contentComponent={contentComponent} nonce={nonce} identiconAddress={identiconAddress} - errorMessage={errorMessage} + errorMessage={errorMessage || submitError} errorKey={propsErrorKey || errorKey} warning={warning} disabled={!propsValid || !valid || submitting} |