mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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,
|
unapprovedTxCount: PropTypes.number,
|
||||||
origin: PropTypes.string.isRequired,
|
origin: PropTypes.string.isRequired,
|
||||||
ethGasPriceWarning: PropTypes.string,
|
ethGasPriceWarning: PropTypes.string,
|
||||||
|
networkIdentifier: PropTypes.string,
|
||||||
// Navigation
|
// Navigation
|
||||||
totalTx: PropTypes.number,
|
totalTx: PropTypes.number,
|
||||||
positionOfCurrentTx: PropTypes.number,
|
positionOfCurrentTx: PropTypes.number,
|
||||||
@ -151,6 +152,7 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
nativeCurrency,
|
nativeCurrency,
|
||||||
showBuyModal,
|
showBuyModal,
|
||||||
isBuyableChain,
|
isBuyableChain,
|
||||||
|
networkIdentifier,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const showAddToAddressDialog =
|
const showAddToAddressDialog =
|
||||||
@ -164,7 +166,8 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
currentTransaction.type === TRANSACTION_TYPES.DEPLOY_CONTRACT) &&
|
currentTransaction.type === TRANSACTION_TYPES.DEPLOY_CONTRACT) &&
|
||||||
currentTransaction.txParams?.value === '0x0';
|
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;
|
const { t } = this.context;
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import {
|
|||||||
getAccountsWithLabels,
|
getAccountsWithLabels,
|
||||||
getAddressBookEntry,
|
getAddressBookEntry,
|
||||||
getIsBuyableChain,
|
getIsBuyableChain,
|
||||||
|
getNetworkIdentifier,
|
||||||
} from '../../../selectors';
|
} from '../../../selectors';
|
||||||
import { showModal } from '../../../store/actions';
|
import { showModal } from '../../../store/actions';
|
||||||
import ConfirmPageContainer from './confirm-page-container.component';
|
import ConfirmPageContainer from './confirm-page-container.component';
|
||||||
@ -11,6 +12,7 @@ function mapStateToProps(state, ownProps) {
|
|||||||
const to = ownProps.toAddress;
|
const to = ownProps.toAddress;
|
||||||
const isBuyableChain = getIsBuyableChain(state);
|
const isBuyableChain = getIsBuyableChain(state);
|
||||||
const contact = getAddressBookEntry(state, to);
|
const contact = getAddressBookEntry(state, to);
|
||||||
|
const networkIdentifier = getNetworkIdentifier(state);
|
||||||
return {
|
return {
|
||||||
isBuyableChain,
|
isBuyableChain,
|
||||||
contact,
|
contact,
|
||||||
@ -19,6 +21,7 @@ function mapStateToProps(state, ownProps) {
|
|||||||
.map((accountWithLabel) => accountWithLabel.address)
|
.map((accountWithLabel) => accountWithLabel.address)
|
||||||
.includes(to),
|
.includes(to),
|
||||||
to,
|
to,
|
||||||
|
networkIdentifier,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user