Skip to content

Commit

Permalink
fix(starter-dapp): check network.chain non null (#13515)
Browse files Browse the repository at this point in the history
Co-authored-by: jeff <[email protected]>
  • Loading branch information
LouisWT and cyberhorsey authored Mar 31, 2023
1 parent 8edd302 commit 02eb83b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/starter-dapp/src/components/buttons/Connect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
const { chain } = getNetwork();
await setSigner();
await changeChain(chain.id);
watchNetwork(async (network) => await changeChain(network.chain.id));
watchNetwork(async (network) => {
if (network.chain?.id) {
changeChain(network.chain.id);
}
});
}
async function connectWithConnector(connector: Connector) {
Expand Down

0 comments on commit 02eb83b

Please sign in to comment.