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:
parent
f8e850bbfa
commit
284bab1cbc
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user