Skip to content

Commit ae30efb

Browse files
committed
fix: only reconnect EOAs if they're cached as connected
1 parent 02b227f commit ae30efb

File tree

3 files changed

+20
-44
lines changed

3 files changed

+20
-44
lines changed

account-kit/core/src/hydrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function hydrate(
7575
config._internal.wagmiConfig,
7676
{
7777
initialState: initialWagmiState,
78-
reconnectOnMount: true,
78+
reconnectOnMount: (initialWagmiState?.connections?.size ?? 0) > 0,
7979
}
8080
);
8181

examples/ui-demo/src/components/small-cards/Wrapper.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
import { useConfigStore } from "@/state";
2+
import { useSigner, useSignerStatus, useUser } from "@account-kit/react";
3+
import { useEffect } from "react";
4+
import { MintCard } from "./MintCard";
15
import { SolanaCard } from "./SolanaCard";
26
import { TransactionsCard } from "./TransactionsCard";
3-
import { MintCard } from "./MintCard";
4-
import { useConfigStore } from "@/state";
57

68
export const SmallCardsWrapper = () => {
79
const { accountMode } = useConfigStore();
10+
const user = useUser();
11+
const signer = useSigner();
12+
const status = useSignerStatus();
13+
useEffect(() => {
14+
if (!user || !status.isConnected) return;
15+
16+
(async () => {
17+
console.log({
18+
user,
19+
authDetails: await signer?.getAuthDetails(),
20+
whoami: await signer?.inner.stampWhoami(),
21+
});
22+
})();
23+
}, [user, signer, status.isConnected]);
24+
825
return (
926
<div className="flex flex-col xl:flex-row gap-6 lg:mt-6 items-center w-full justify-center max-w-screen-sm xl:max-w-none">
1027
<MintCard accountMode={accountMode} key={`mint-card-${accountMode}`} />

site/pages/reference/account-kit/signer/classes/BaseAlchemySigner/toSolanaSigner.mdx

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)