1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Fix speed up functionality

This commit is contained in:
Alexander Tseung 2018-09-14 20:19:13 -07:00
parent 2ec09362c5
commit b062fe2e99
2 changed files with 12 additions and 5 deletions

View File

@ -13,8 +13,9 @@ export default class TransactionListItemDetails extends PureComponent {
}
static propTypes = {
transaction: PropTypes.object,
onRetry: PropTypes.func,
showRetry: PropTypes.bool,
transaction: PropTypes.object,
}
handleEtherscanClick = () => {
@ -26,6 +27,13 @@ export default class TransactionListItemDetails extends PureComponent {
this.setState({ showTransactionDetails: true })
}
handleRetry = event => {
const { onRetry } = this.props
event.stopPropagation()
onRetry()
}
render () {
const { t } = this.context
const { transaction, showRetry } = this.props
@ -40,7 +48,7 @@ export default class TransactionListItemDetails extends PureComponent {
showRetry && (
<Button
type="raised"
onClick={this.handleEtherscanClick}
onClick={this.handleRetry}
className="transaction-list-item-details__header-button"
>
{ t('speedUp') }

View File

@ -42,9 +42,7 @@ export default class TransactionListItem extends PureComponent {
this.setState({ showTransactionDetails: !showTransactionDetails })
}
handleRetryClick = event => {
event.stopPropagation()
handleRetry = () => {
const {
transaction: { txParams: { to } = {} },
methodData: { name } = {},
@ -156,6 +154,7 @@ export default class TransactionListItem extends PureComponent {
<TransactionListItemDetails
transaction={transaction}
showRetry={showRetry && methodData.done}
onRetry={this.handleRetry}
/>
</div>
)