File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
apps/namadillo/src/App/Layout Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11import { connectedWalletsAtom } from "atoms/integrations" ;
2+ import { useWalletManager } from "hooks/useWalletManager" ;
23import { wallets } from "integrations" ;
34import { KeplrWalletManager } from "integrations/Keplr" ;
45import { useAtom } from "jotai" ;
6+ import { useEffect } from "react" ;
57import { AccountIconButton } from "./AccountIconButton" ;
68import { DisconnectAccountIcon } from "./DisconnectAccountIcon" ;
79
810export 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 < > </ > ;
You can’t perform that action at this time.
0 commit comments