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

fix stuck speedup problem (#12122)

This commit is contained in:
Brad Decker 2021-09-15 16:42:06 -05:00 committed by GitHub
parent 9d968bae1e
commit 2100fb0ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 34 deletions

View File

@ -100,11 +100,8 @@ export default class TransactionBreakdown extends PureComponent {
/>
</TransactionBreakdownRow>
)}
{isEIP1559Transaction && (
{isEIP1559Transaction && typeof baseFee !== 'undefined' ? (
<TransactionBreakdownRow title={t('transactionHistoryBaseFee')}>
{typeof baseFee === 'undefined' ? (
'?'
) : (
<CurrencyDisplay
className="transaction-breakdown__value"
data-testid="transaction-breakdown__base-fee"
@ -114,14 +111,10 @@ export default class TransactionBreakdown extends PureComponent {
numberOfDecimals={10}
hideLabel
/>
)}
</TransactionBreakdownRow>
)}
{isEIP1559Transaction && (
) : null}
{isEIP1559Transaction && typeof priorityFee !== 'undefined' ? (
<TransactionBreakdownRow title={t('transactionHistoryPriorityFee')}>
{typeof priorityFee === 'undefined' ? (
'?'
) : (
<CurrencyDisplay
className="transaction-breakdown__value"
data-testid="transaction-breakdown__priority-fee"
@ -131,9 +124,8 @@ export default class TransactionBreakdown extends PureComponent {
numberOfDecimals={10}
hideLabel
/>
)}
</TransactionBreakdownRow>
)}
) : null}
{!isEIP1559Transaction && (
<TransactionBreakdownRow title={t('advancedGasPriceTitle')}>
{typeof gasPrice === 'undefined' ? (

View File

@ -281,11 +281,17 @@ export const nonceSortedTransactionsSelector = createSelector(
nonceProps.initialTransaction = transaction;
}
if (type === TRANSACTION_TYPES.RETRY) {
if (
type === TRANSACTION_TYPES.RETRY &&
status in PRIORITY_STATUS_HASH
) {
nonceProps.hasRetried = true;
}
if (type === TRANSACTION_TYPES.CANCEL) {
if (
type === TRANSACTION_TYPES.CANCEL &&
status in PRIORITY_STATUS_HASH
) {
nonceProps.hasCancelled = true;
}
} else {
@ -294,8 +300,12 @@ export const nonceSortedTransactionsSelector = createSelector(
transactions: [transaction],
initialTransaction: transaction,
primaryTransaction: transaction,
hasRetried: transaction.type === TRANSACTION_TYPES.RETRY,
hasCancelled: transaction.type === TRANSACTION_TYPES.CANCEL,
hasRetried:
transaction.type === TRANSACTION_TYPES.RETRY &&
transaction.status in PRIORITY_STATUS_HASH,
hasCancelled:
transaction.type === TRANSACTION_TYPES.CANCEL &&
transaction.status in PRIORITY_STATUS_HASH,
};
insertOrderedNonce(orderedNonces, nonce);