File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,6 @@ export function networksComponent(parentContainer) {
69
69
}
70
70
} ) ;
71
71
72
- // Update current network display when chain changes
73
- document . addEventListener ( 'newNetwork' , ( ) => {
74
- updateCurrentNetworkDisplay ( ) ;
75
- } ) ;
76
-
77
72
// Initial update
78
73
updateCurrentNetworkDisplay ( ) ;
79
74
}
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ import {
47
47
} from './components/interactions' ;
48
48
import { sendFormComponent } from './components/forms/send-form' ;
49
49
import { eip5792Component } from './components/transactions/eip5792' ;
50
+ import {
51
+ updateCurrentNetworkDisplay ,
52
+ updateActiveNetworkInModal ,
53
+ } from './components/connections/networks-helpers' ;
50
54
51
55
const {
52
56
hstBytecode,
@@ -435,6 +439,8 @@ const handleNewChain = (chainId) => {
435
439
if ( ! scrollToHandled ) {
436
440
handleScrollTo ( { delay : true } ) ;
437
441
}
442
+ updateCurrentNetworkDisplay ( ) ;
443
+ updateActiveNetworkInModal ( ) ;
438
444
} ;
439
445
440
446
function handleNewNetwork ( networkId ) {
You can’t perform that action at this time.
0 commit comments