mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
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 <adonesky@gmail.com> * Fix typo * Fix isTestNet property name casing Co-authored-by: Alex Donesky <adonesky@gmail.com>
This commit is contained in:
parent
9e1cbe2723
commit
b5049a1736
@ -109,6 +109,7 @@ export default class Routes extends Component {
|
|||||||
isNetworkUsed: PropTypes.bool,
|
isNetworkUsed: PropTypes.bool,
|
||||||
allAccountsOnNetworkAreEmpty: PropTypes.bool,
|
allAccountsOnNetworkAreEmpty: PropTypes.bool,
|
||||||
isTestNet: PropTypes.bool,
|
isTestNet: PropTypes.bool,
|
||||||
|
currentChainId: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@ -366,6 +367,7 @@ export default class Routes extends Component {
|
|||||||
isNetworkUsed,
|
isNetworkUsed,
|
||||||
allAccountsOnNetworkAreEmpty,
|
allAccountsOnNetworkAreEmpty,
|
||||||
isTestNet,
|
isTestNet,
|
||||||
|
currentChainId,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const loadMessage =
|
const loadMessage =
|
||||||
loadingMessage || isNetworkLoading
|
loadingMessage || isNetworkLoading
|
||||||
@ -374,6 +376,7 @@ export default class Routes extends Component {
|
|||||||
|
|
||||||
const shouldShowNetworkInfo =
|
const shouldShowNetworkInfo =
|
||||||
isUnlocked &&
|
isUnlocked &&
|
||||||
|
currentChainId &&
|
||||||
!isTestNet &&
|
!isTestNet &&
|
||||||
!isNetworkUsed &&
|
!isNetworkUsed &&
|
||||||
allAccountsOnNetworkAreEmpty;
|
allAccountsOnNetworkAreEmpty;
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
isNetworkLoading,
|
isNetworkLoading,
|
||||||
getTheme,
|
getTheme,
|
||||||
getIsTestnet,
|
getIsTestnet,
|
||||||
|
getCurrentChainId,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import {
|
import {
|
||||||
lockMetamask,
|
lockMetamask,
|
||||||
@ -45,7 +46,8 @@ function mapStateToProps(state) {
|
|||||||
sendStage: getSendStage(state),
|
sendStage: getSendStage(state),
|
||||||
isNetworkUsed: getIsNetworkUsed(state),
|
isNetworkUsed: getIsNetworkUsed(state),
|
||||||
allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state),
|
allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state),
|
||||||
isTestnet: getIsTestnet(state),
|
isTestNet: getIsTestnet(state),
|
||||||
|
currentChainId: getCurrentChainId(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user