File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
packages/thirdweb/src/react/core/utils Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Show injected wallet icon when available
Original file line number Diff line number Diff line change @@ -194,10 +194,19 @@ export function useWalletInfo(id: WalletId | undefined) {
194194export function useWalletImage ( id : WalletId | undefined ) {
195195 return useQuery ( {
196196 queryKey : [ "wallet-image" , id ] ,
197- queryFn : ( ) => {
197+ queryFn : async ( ) => {
198198 if ( ! id ) {
199199 throw new Error ( "Wallet id is required" ) ;
200200 }
201+ const { getInstalledWalletProviders } = await import (
202+ "../../../wallets/injected/mipdStore.js"
203+ ) ;
204+ const mipdImage = getInstalledWalletProviders ( ) . find (
205+ ( x ) => x . info . rdns === id ,
206+ ) ?. info . icon ;
207+ if ( mipdImage ) {
208+ return mipdImage ;
209+ }
201210 return getWalletInfo ( id , true ) ;
202211 } ,
203212 retry : false ,
Original file line number Diff line number Diff line change @@ -129,8 +129,15 @@ export function useWalletIcon(props: {
129129/**
130130 * @internal Exported for tests only
131131 */
132- export async function fetchWalletImage ( props : {
133- id : WalletId ;
134- } ) {
132+ export async function fetchWalletImage ( props : { id : WalletId } ) {
133+ const { getInstalledWalletProviders } = await import (
134+ "../../../wallets/injected/mipdStore.js"
135+ ) ;
136+ const mipdImage = getInstalledWalletProviders ( ) . find (
137+ ( x ) => x . info . rdns === props . id ,
138+ ) ?. info . icon ;
139+ if ( mipdImage ) {
140+ return mipdImage ;
141+ }
135142 return getWalletInfo ( props . id , true ) ;
136143}
You can’t perform that action at this time.
0 commit comments