Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow speeding up of all submitted txs from the activity log. #9928

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('TransactionActivityLog Component', function () {
assert.ok(wrapper.hasClass('test-class'))
})

it('should render inline retry and cancel buttons for earliest pending transaction', function () {
it('should render inline retry and cancel buttons for earliest pending transaction and submitted transactions', function () {
const activities = [
{
eventKey: 'transactionCreated',
Expand Down Expand Up @@ -111,11 +111,11 @@ describe('TransactionActivityLog Component', function () {
assert.ok(wrapper.hasClass('test-class'))
assert.equal(
wrapper.find('.transaction-activity-log__action-link').length,
2,
3,
)
})

it('should not render inline retry and cancel buttons for newer pending transactions', function () {
it('should not render inline retry and cancel buttons for newer pending transactions but does for submitted transactions', function () {
const activities = [
{
eventKey: 'transactionCreated',
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('TransactionActivityLog Component', function () {
assert.ok(wrapper.hasClass('test-class'))
assert.equal(
wrapper.find('.transaction-activity-log__action-link').length,
0,
1,
)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import {
import { formatDate } from '../../../helpers/utils/util'
import { getEtherscanNetworkPrefix } from '../../../../lib/etherscan-prefix-for-network'
import TransactionActivityLogIcon from './transaction-activity-log-icon'
import { CONFIRMED_STATUS } from './transaction-activity-log.constants'
import {
CONFIRMED_STATUS,
TRANSACTION_SUBMITTED_EVENT,
} from './transaction-activity-log.constants'

export default class TransactionActivityLog extends PureComponent {
static contextTypes = {
Expand Down Expand Up @@ -39,7 +42,7 @@ export default class TransactionActivityLog extends PureComponent {
global.platform.openTab({ url: etherscanUrl })
}

renderInlineRetry(index) {
renderInlineRetry(activity, index) {
const { t } = this.context
const {
inlineRetryIndex,
Expand All @@ -48,10 +51,12 @@ export default class TransactionActivityLog extends PureComponent {
isEarliestNonce,
} = this.props
const { status } = primaryTransaction
const { eventKey } = activity

return isEarliestNonce &&
return (isEarliestNonce &&
status !== CONFIRMED_STATUS &&
index === inlineRetryIndex ? (
index === inlineRetryIndex) ||
eventKey === TRANSACTION_SUBMITTED_EVENT ? (
<div className="transaction-activity-log__action-link" onClick={onRetry}>
{t('speedUpTransaction')}
</div>
Expand Down Expand Up @@ -115,7 +120,7 @@ export default class TransactionActivityLog extends PureComponent {
>
{activityText}
</div>
{this.renderInlineRetry(index)}
{this.renderInlineRetry(activity, index)}
{this.renderInlineCancel(index)}
</div>
</div>
Expand Down