File tree 3 files changed +25
-4
lines changed
packages/thirdweb/src/react/core/utils
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) {
194
194
export function useWalletImage ( id : WalletId | undefined ) {
195
195
return useQuery ( {
196
196
queryKey : [ "wallet-image" , id ] ,
197
- queryFn : ( ) => {
197
+ queryFn : async ( ) => {
198
198
if ( ! id ) {
199
199
throw new Error ( "Wallet id is required" ) ;
200
200
}
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
+ }
201
210
return getWalletInfo ( id , true ) ;
202
211
} ,
203
212
retry : false ,
Original file line number Diff line number Diff line change @@ -129,8 +129,15 @@ export function useWalletIcon(props: {
129
129
/**
130
130
* @internal Exported for tests only
131
131
*/
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
+ }
135
142
return getWalletInfo ( props . id , true ) ;
136
143
}
You can’t perform that action at this time.
0 commit comments