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

feature/default_network_editable
Dan J Miller 3 years ago
parent c9b00541cd
commit 16fe8744a6
  1. 5
      ui/components/app/confirm-page-container/confirm-page-container.component.js
  2. 3
      ui/components/app/confirm-page-container/confirm-page-container.container.js

@ -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…
Cancel
Save