mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-24 01:49:06 +00:00
Tighten web3 network change refresh validation (#2014)
* Add a check to make sure a network even exists on the web3Wallet instance * Format snap files
This commit is contained in:
parent
bb2965e4df
commit
e68e3ccc2f
@ -12,7 +12,9 @@ Object {
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`handleChangeNodeRequested* should select getCustomNodeConfig and match race snapshot 1`] = `
|
exports[
|
||||||
|
`handleChangeNodeRequested* should select getCustomNodeConfig and match race snapshot 1`
|
||||||
|
] = `
|
||||||
Object {
|
Object {
|
||||||
"@@redux-saga/IO": true,
|
"@@redux-saga/IO": true,
|
||||||
"SELECT": Object {
|
"SELECT": Object {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`getDeterministicWallets* starting from publicKey & chainCode should match put snapshot 1`] = `
|
exports[
|
||||||
|
`getDeterministicWallets* starting from publicKey & chainCode should match put snapshot 1`
|
||||||
|
] = `
|
||||||
Object {
|
Object {
|
||||||
"@@redux-saga/IO": true,
|
"@@redux-saga/IO": true,
|
||||||
"PUT": Object {
|
"PUT": Object {
|
||||||
|
@ -37,7 +37,12 @@ export default async function handleMetaMaskPolling(store: Store<AppState>): Pro
|
|||||||
const actualChainId = await getActualChainId();
|
const actualChainId = await getActualChainId();
|
||||||
const actualNetwork = configNetworksSelectors.getNetworkByChainId(state, actualChainId);
|
const actualNetwork = configNetworksSelectors.getNetworkByChainId(state, actualChainId);
|
||||||
|
|
||||||
if (web3Wallet && actualNetwork && (web3Wallet as Web3Wallet).network !== actualNetwork.id) {
|
if (
|
||||||
|
web3Wallet &&
|
||||||
|
(web3Wallet as Web3Wallet).network &&
|
||||||
|
actualNetwork &&
|
||||||
|
(web3Wallet as Web3Wallet).network !== actualNetwork.id
|
||||||
|
) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user