Skip to content

Commit

Permalink
fix: autoconnect once
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Apr 23, 2022
1 parent 51c0803 commit 8e254a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-cycles-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@starknet-react/core': patch
---

ensure autoconnect executes once
5 changes: 4 additions & 1 deletion packages/core/src/providers/starknet/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export function useStarknetManager({
if (autoConnect && !account) {
tryAutoConnect(connectors)
}
}, [account, autoConnect, connectors])
// Dependencies intentionally omitted since we only want
// this executed once.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return { account, connect, connectors, library, error }
}

0 comments on commit 8e254a7

Please sign in to comment.