Skip to content

Commit 284bab1

Browse files
authored
Ensure network name in confirm page container is defined (#14520)
1 parent f8e850b commit 284bab1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ui/components/app/confirm-page-container/confirm-page-container.component.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default class ConfirmPageContainer extends Component {
7070
unapprovedTxCount: PropTypes.number,
7171
origin: PropTypes.string.isRequired,
7272
ethGasPriceWarning: PropTypes.string,
73+
networkIdentifier: PropTypes.string,
7374
// Navigation
7475
totalTx: PropTypes.number,
7576
positionOfCurrentTx: PropTypes.number,
@@ -151,6 +152,7 @@ export default class ConfirmPageContainer extends Component {
151152
nativeCurrency,
152153
showBuyModal,
153154
isBuyableChain,
155+
networkIdentifier,
154156
} = this.props;
155157

156158
const showAddToAddressDialog =
@@ -164,7 +166,8 @@ export default class ConfirmPageContainer extends Component {
164166
currentTransaction.type === TRANSACTION_TYPES.DEPLOY_CONTRACT) &&
165167
currentTransaction.txParams?.value === '0x0';
166168

167-
const networkName = NETWORK_TO_NAME_MAP[currentTransaction.chainId];
169+
const networkName =
170+
NETWORK_TO_NAME_MAP[currentTransaction.chainId] || networkIdentifier;
168171

169172
const { t } = this.context;
170173

ui/components/app/confirm-page-container/confirm-page-container.container.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
getAccountsWithLabels,
44
getAddressBookEntry,
55
getIsBuyableChain,
6+
getNetworkIdentifier,
67
} from '../../../selectors';
78
import { showModal } from '../../../store/actions';
89
import ConfirmPageContainer from './confirm-page-container.component';
@@ -11,6 +12,7 @@ function mapStateToProps(state, ownProps) {
1112
const to = ownProps.toAddress;
1213
const isBuyableChain = getIsBuyableChain(state);
1314
const contact = getAddressBookEntry(state, to);
15+
const networkIdentifier = getNetworkIdentifier(state);
1416
return {
1517
isBuyableChain,
1618
contact,
@@ -19,6 +21,7 @@ function mapStateToProps(state, ownProps) {
1921
.map((accountWithLabel) => accountWithLabel.address)
2022
.includes(to),
2123
to,
24+
networkIdentifier,
2225
};
2326
}
2427

0 commit comments

Comments
 (0)