From b5049a173607e418be6597854743f6dff567a95e Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 19 Sep 2022 13:09:28 -0230 Subject: [PATCH] Ensure New Network Info popup doesn't show when switching to testnets (#15867) * Ensure New Network Info popup doesn't show when switching to testnets * Update ui/pages/routes/routes.component.js Co-authored-by: Alex Donesky * Fix typo * Fix isTestNet property name casing Co-authored-by: Alex Donesky --- ui/pages/routes/routes.component.js | 3 +++ ui/pages/routes/routes.container.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index 14b2e1e15..b2f484866 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -109,6 +109,7 @@ export default class Routes extends Component { isNetworkUsed: PropTypes.bool, allAccountsOnNetworkAreEmpty: PropTypes.bool, isTestNet: PropTypes.bool, + currentChainId: PropTypes.string, }; static contextTypes = { @@ -366,6 +367,7 @@ export default class Routes extends Component { isNetworkUsed, allAccountsOnNetworkAreEmpty, isTestNet, + currentChainId, } = this.props; const loadMessage = loadingMessage || isNetworkLoading @@ -374,6 +376,7 @@ export default class Routes extends Component { const shouldShowNetworkInfo = isUnlocked && + currentChainId && !isTestNet && !isNetworkUsed && allAccountsOnNetworkAreEmpty; diff --git a/ui/pages/routes/routes.container.js b/ui/pages/routes/routes.container.js index 8d02b1399..b70872e64 100644 --- a/ui/pages/routes/routes.container.js +++ b/ui/pages/routes/routes.container.js @@ -9,6 +9,7 @@ import { isNetworkLoading, getTheme, getIsTestnet, + getCurrentChainId, } from '../../selectors'; import { lockMetamask, @@ -45,7 +46,8 @@ function mapStateToProps(state) { sendStage: getSendStage(state), isNetworkUsed: getIsNetworkUsed(state), allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state), - isTestnet: getIsTestnet(state), + isTestNet: getIsTestnet(state), + currentChainId: getCurrentChainId(state), }; }