Skip to content

Commit

Permalink
Hide gas timing component on transaction screen when on a non-1559 ne…
Browse files Browse the repository at this point in the history
…twork
  • Loading branch information
danjm committed Jul 27, 2021
1 parent 503d625 commit 8782855
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export default class ConfirmTransactionBase extends Component {
isEthGasPrice: PropTypes.bool,
noGasPrice: PropTypes.bool,
setDefaultHomeActiveTabName: PropTypes.func,
supportsEIP1599: PropTypes.bool,
};

state = {
Expand Down Expand Up @@ -303,6 +304,7 @@ export default class ConfirmTransactionBase extends Component {
isEthGasPrice,
noGasPrice,
txData,
supportsEIP1599,
} = this.props;
const { t } = this.context;

Expand Down Expand Up @@ -441,11 +443,13 @@ export default class ConfirmTransactionBase extends Component {
/>,
])}
subTitle={
<GasTiming
maxPriorityFeePerGas={
txData.txParams.maxPriorityFeePerGas
}
/>
supportsEIP1599 && (
<GasTiming
maxPriorityFeePerGas={
txData.txParams.maxPriorityFeePerGas
}
/>
)
}
/>,
<TransactionDetailItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ import {
import { getMostRecentOverviewPage } from '../../ducks/history/history';
import { transactionMatchesNetwork } from '../../../shared/modules/transaction.utils';
import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
import { updateTransactionGasFees } from '../../ducks/metamask/metamask';
import {
updateTransactionGasFees,
isEIP1559Network,
} from '../../ducks/metamask/metamask';
import ConfirmTransactionBase from './confirm-transaction-base.component';

const casedContractMap = Object.keys(contractMap).reduce((acc, base) => {
Expand All @@ -65,6 +68,7 @@ const mapStateToProps = (state, ownProps) => {
} = ownProps;
const { id: paramsTransactionId } = params;
const isMainnet = getIsMainnet(state);
const supportsEIP1599 = isEIP1559Network(state);
const { confirmTransaction, metamask } = state;
const {
ensResolutionsByAddress,
Expand Down Expand Up @@ -189,6 +193,7 @@ const mapStateToProps = (state, ownProps) => {
isMainnet,
isEthGasPrice,
noGasPrice,
supportsEIP1599,
};
};

Expand Down

0 comments on commit 8782855

Please sign in to comment.