File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -400,17 +400,17 @@ export const setSelectedNetwork = createBackgroundAsyncThunk(
400
400
401
401
export const toggleShowTestNetworks = createBackgroundAsyncThunk (
402
402
"ui/toggleShowTestNetworks" ,
403
- async ( value : boolean , { dispatch, getState } ) => {
403
+ async ( updatedValue : boolean , { dispatch, getState } ) => {
404
404
const state = getState ( ) as RootState
405
405
406
406
const currentNetwork = state . ui . selectedAccount . network
407
407
408
408
// If user is on one of the built-in test networks, don't leave them stranded
409
- if ( TEST_NETWORK_BY_CHAIN_ID . has ( currentNetwork . chainID ) ) {
409
+ if ( ! updatedValue && TEST_NETWORK_BY_CHAIN_ID . has ( currentNetwork . chainID ) ) {
410
410
dispatch ( setSelectedNetwork ( ETHEREUM ) )
411
411
}
412
412
413
- await emitter . emit ( "toggleShowTestNetworks" , value )
413
+ await emitter . emit ( "toggleShowTestNetworks" , updatedValue )
414
414
} ,
415
415
)
416
416
You can’t perform that action at this time.
0 commit comments