Skip to content

Commit 81d3b06

Browse files
committed
tweaks
1 parent 2b1f4e9 commit 81d3b06

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/components/connections/networks.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ export function networksComponent(parentContainer) {
6969
}
7070
});
7171

72-
// Update current network display when chain changes
73-
document.addEventListener('newNetwork', () => {
74-
updateCurrentNetworkDisplay();
75-
});
76-
7772
// Initial update
7873
updateCurrentNetworkDisplay();
7974
}

src/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ import {
4747
} from './components/interactions';
4848
import { sendFormComponent } from './components/forms/send-form';
4949
import { eip5792Component } from './components/transactions/eip5792';
50+
import {
51+
updateCurrentNetworkDisplay,
52+
updateActiveNetworkInModal,
53+
} from './components/connections/networks-helpers';
5054

5155
const {
5256
hstBytecode,
@@ -435,6 +439,8 @@ const handleNewChain = (chainId) => {
435439
if (!scrollToHandled) {
436440
handleScrollTo({ delay: true });
437441
}
442+
updateCurrentNetworkDisplay();
443+
updateActiveNetworkInModal();
438444
};
439445

440446
function handleNewNetwork(networkId) {

0 commit comments

Comments
 (0)