From cf6bead7ef1fea81f44abc26e4bf6847b9624d0d Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Wed, 26 Sep 2018 14:58:27 -0700 Subject: Close transaction details modal when clicking speed up --- .../transaction-details/transaction-details.component.js | 10 ++++++++-- .../transaction-list-item/transaction-list-item.component.js | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/components/modals/transaction-details/transaction-details.component.js b/ui/app/components/modals/transaction-details/transaction-details.component.js index ef438d01f..f2fec3409 100644 --- a/ui/app/components/modals/transaction-details/transaction-details.component.js +++ b/ui/app/components/modals/transaction-details/transaction-details.component.js @@ -22,9 +22,15 @@ export default class TransactionConfirmed extends PureComponent { this.props.hideModal() } + handleRetry = () => { + const { onRetry, hideModal } = this.props + + Promise.resolve(onRetry()).then(() => hideModal()) + } + render () { const { t } = this.context - const { transaction, onRetry, showRetry, onCancel, showCancel } = this.props + const { transaction, showRetry, onCancel, showCancel } = this.props const { txParams: { nonce } = {} } = transaction const decimalNonce = nonce && hexToDecimal(nonce) @@ -37,7 +43,7 @@ export default class TransactionConfirmed extends PureComponent { > onRetry()} + onRetry={this.handleRetry} showRetry={showRetry} onCancel={() => onCancel()} showCancel={showCancel} diff --git a/ui/app/components/transaction-list-item/transaction-list-item.component.js b/ui/app/components/transaction-list-item/transaction-list-item.component.js index 9dfba875e..c1c69f59b 100644 --- a/ui/app/components/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/transaction-list-item/transaction-list-item.component.js @@ -81,12 +81,12 @@ export default class TransactionListItem extends PureComponent { setSelectedToken(to) } - this.resubmit() + return this.resubmit() } resubmit () { const { transaction: { id }, retryTransaction, history } = this.props - retryTransaction(id) + return retryTransaction(id) .then(id => history.push(`${CONFIRM_TRANSACTION_ROUTE}/${id}`)) } -- cgit v1.2.3