Skip to content

Commit 42c8227

Browse files
authored
fix: Update keplr connect check and update to use latest SDK (#2295)
1 parent a9d1b58 commit 42c8227

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/namadillo/src/App/Layout/KeplrAccount.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
import { connectedWalletsAtom } from "atoms/integrations";
2+
import { useWalletManager } from "hooks/useWalletManager";
23
import { wallets } from "integrations";
34
import { KeplrWalletManager } from "integrations/Keplr";
45
import { useAtom } from "jotai";
6+
import { useEffect } from "react";
57
import { AccountIconButton } from "./AccountIconButton";
68
import { DisconnectAccountIcon } from "./DisconnectAccountIcon";
79

810
export const KeplrAccount = (): JSX.Element => {
911
const [connectedWallets, setConnectedWallets] = useAtom(connectedWalletsAtom);
12+
const keplrWallet = new KeplrWalletManager();
13+
const { walletAddress: connectedKeplrAddress } =
14+
useWalletManager(keplrWallet);
15+
16+
useEffect(() => {
17+
if (!connectedKeplrAddress)
18+
setConnectedWallets((obj) => ({ ...obj, [keplrWallet.key]: false }));
19+
}, [connectedKeplrAddress]);
1020

1121
if (!connectedWallets.keplr) {
1222
return <></>;

0 commit comments

Comments
 (0)