1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Ensure network name in confirm page container is defined (#14520)

This commit is contained in:
Dan J Miller 2022-04-25 15:04:44 -02:30 committed by GitHub
parent f8e850bbfa
commit 284bab1cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -70,6 +70,7 @@ export default class ConfirmPageContainer extends Component {
unapprovedTxCount: PropTypes.number,
origin: PropTypes.string.isRequired,
ethGasPriceWarning: PropTypes.string,
networkIdentifier: PropTypes.string,
// Navigation
totalTx: PropTypes.number,
positionOfCurrentTx: PropTypes.number,
@ -151,6 +152,7 @@ export default class ConfirmPageContainer extends Component {
nativeCurrency,
showBuyModal,
isBuyableChain,
networkIdentifier,
} = this.props;
const showAddToAddressDialog =
@ -164,7 +166,8 @@ export default class ConfirmPageContainer extends Component {
currentTransaction.type === TRANSACTION_TYPES.DEPLOY_CONTRACT) &&
currentTransaction.txParams?.value === '0x0';
const networkName = NETWORK_TO_NAME_MAP[currentTransaction.chainId];
const networkName =
NETWORK_TO_NAME_MAP[currentTransaction.chainId] || networkIdentifier;
const { t } = this.context;

View File

@ -3,6 +3,7 @@ import {
getAccountsWithLabels,
getAddressBookEntry,
getIsBuyableChain,
getNetworkIdentifier,
} from '../../../selectors';
import { showModal } from '../../../store/actions';
import ConfirmPageContainer from './confirm-page-container.component';
@ -11,6 +12,7 @@ function mapStateToProps(state, ownProps) {
const to = ownProps.toAddress;
const isBuyableChain = getIsBuyableChain(state);
const contact = getAddressBookEntry(state, to);
const networkIdentifier = getNetworkIdentifier(state);
return {
isBuyableChain,
contact,
@ -19,6 +21,7 @@ function mapStateToProps(state, ownProps) {
.map((accountWithLabel) => accountWithLabel.address)
.includes(to),
to,
networkIdentifier,
};
}