Skip to content

Commit

Permalink
better switching between chains
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Mar 23, 2024
1 parent 7189047 commit 5fcd4dc
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 489 deletions.
11 changes: 3 additions & 8 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,7 @@ export default {
methods: {
changeNetwork(networkName) {
const networkData = this.switchNetwork(networkName);
window.ethereum.request({
method: networkData.method,
params: networkData.params
});
const networkData = this.switchOrAddChain(window.ethereum, networkName);
},
logout() {
Expand All @@ -150,10 +145,10 @@ export default {
const { open } = useBoard();
const { disconnect } = useWallet();
const { chainId, isActivated } = useEthers();
const { switchNetwork } = useChainHelpers();
const { switchOrAddChain } = useChainHelpers();
return {
chainId, isActivated, disconnect, open, switchNetwork
chainId, isActivated, disconnect, open, switchOrAddChain
}
}
}
Expand Down
Loading

0 comments on commit 5fcd4dc

Please sign in to comment.