File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/appkit/src/hooks Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @reown/appkit-react-native ' : patch
3+ ' @reown/appkit-ui-react-native ' : patch
4+ ' @reown/appkit-bitcoin-react-native ' : patch
5+ ' @reown/appkit-coinbase-react-native ' : patch
6+ ' @reown/appkit-common-react-native ' : patch
7+ ' @reown/appkit-core-react-native ' : patch
8+ ' @reown/appkit-ethers-react-native ' : patch
9+ ' @reown/appkit-solana-react-native ' : patch
10+ ' @reown/appkit-wagmi-react-native ' : patch
11+ ---
12+
13+ fix: useAccount hook now returns empty array if appkit is not connected
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ export function useAccount() {
7575 } = useSnapshot ( ConnectionsController . state ) ;
7676
7777 const allAccounts : Account [ ] = useMemo ( ( ) => {
78+ if ( ! address ) return [ ] ;
79+
7880 return Array . from ( connections . values ( ) ) . flatMap (
7981 _connection =>
8082 _connection . accounts
@@ -97,7 +99,7 @@ export function useAccount() {
9799 } )
98100 . filter ( account => account !== undefined ) as Account [ ]
99101 ) ;
100- } , [ connections ] ) ;
102+ } , [ connections , address ] ) ;
101103
102104 const activeChain = useMemo (
103105 ( ) =>
You can’t perform that action at this time.
0 commit comments