Skip to content

Commit

Permalink
feature: fix network switch logic (#2373)
Browse files Browse the repository at this point in the history
* Bump version

* Fixes dashboard refresh bug

* Lint and remove unused code
  • Loading branch information
comountainclimber authored Jan 25, 2022
1 parent 9b7d582 commit 4b040b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions app/containers/App/Sidebar/NetworkSwitch/NetworkSwitch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Props = {
disabled: boolean,
transparent: boolean,
shouldSwitchNetworks: boolean,
loadWalletData: () => void,
loadWalletData: (network: string) => void,
settingsSelect: boolean,
fontSize: number,
net: string,
Expand Down Expand Up @@ -47,9 +47,8 @@ const NetworkSwitch = ({
const handleChange = (option: NetworkItemType) => {
if (shouldSwitchNetworks) {
onChange(option.id)
setTimeout(() => {
loadWalletData()
}, 0)
const network = option.id === '1' ? 'MainNet' : 'TestNet'
loadWalletData(network)
} else {
handleControlledChange(option)
}
Expand Down
5 changes: 3 additions & 2 deletions app/containers/App/Sidebar/NetworkSwitch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ const mapActionsToProps = (actions: Actions): Object => ({
})

const mapAccountActionsToProps = (actions, props) => ({
loadWalletData: () =>
loadWalletData: (net: string) =>
actions.call({
net: props.net,
net,
address: props.address,
tokens: props.tokens,
chain: props.chain,
}),
})

Expand Down

0 comments on commit 4b040b8

Please sign in to comment.