1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Close transaction details modal when clicking speed up

This commit is contained in:
Alexander Tseung 2018-09-26 14:58:27 -07:00 committed by Dan Finlay
parent e4092d740a
commit cf6bead7ef
2 changed files with 10 additions and 4 deletions

View File

@ -22,9 +22,15 @@ export default class TransactionConfirmed extends PureComponent {
this.props.hideModal() this.props.hideModal()
} }
handleRetry = () => {
const { onRetry, hideModal } = this.props
Promise.resolve(onRetry()).then(() => hideModal())
}
render () { render () {
const { t } = this.context const { t } = this.context
const { transaction, onRetry, showRetry, onCancel, showCancel } = this.props const { transaction, showRetry, onCancel, showCancel } = this.props
const { txParams: { nonce } = {} } = transaction const { txParams: { nonce } = {} } = transaction
const decimalNonce = nonce && hexToDecimal(nonce) const decimalNonce = nonce && hexToDecimal(nonce)
@ -37,7 +43,7 @@ export default class TransactionConfirmed extends PureComponent {
> >
<TransactionListItemDetails <TransactionListItemDetails
transaction={transaction} transaction={transaction}
onRetry={() => onRetry()} onRetry={this.handleRetry}
showRetry={showRetry} showRetry={showRetry}
onCancel={() => onCancel()} onCancel={() => onCancel()}
showCancel={showCancel} showCancel={showCancel}

View File

@ -81,12 +81,12 @@ export default class TransactionListItem extends PureComponent {
setSelectedToken(to) setSelectedToken(to)
} }
this.resubmit() return this.resubmit()
} }
resubmit () { resubmit () {
const { transaction: { id }, retryTransaction, history } = this.props const { transaction: { id }, retryTransaction, history } = this.props
retryTransaction(id) return retryTransaction(id)
.then(id => history.push(`${CONFIRM_TRANSACTION_ROUTE}/${id}`)) .then(id => history.push(`${CONFIRM_TRANSACTION_ROUTE}/${id}`))
} }