From 8e254a7fd4585b65937a5c588cf4ddd1d6afbd25 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 20 Apr 2022 16:14:18 -0400 Subject: [PATCH] fix: autoconnect once --- .changeset/cool-cycles-chew.md | 5 +++++ packages/core/src/providers/starknet/manager.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-cycles-chew.md diff --git a/.changeset/cool-cycles-chew.md b/.changeset/cool-cycles-chew.md new file mode 100644 index 00000000..2cdee46b --- /dev/null +++ b/.changeset/cool-cycles-chew.md @@ -0,0 +1,5 @@ +--- +'@starknet-react/core': patch +--- + +ensure autoconnect executes once diff --git a/packages/core/src/providers/starknet/manager.ts b/packages/core/src/providers/starknet/manager.ts index 54b5e6cd..ecba7aec 100644 --- a/packages/core/src/providers/starknet/manager.ts +++ b/packages/core/src/providers/starknet/manager.ts @@ -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 } }