-
Notifications
You must be signed in to change notification settings - Fork 621
[SDK] Show injected wallet icon when available #6871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "thirdweb": patch | ||
| --- | ||
|
|
||
| Show injected wallet icon when available |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,8 +129,15 @@ | |
| /** | ||
| * @internal Exported for tests only | ||
| */ | ||
| export async function fetchWalletImage(props: { | ||
| id: WalletId; | ||
| }) { | ||
| export async function fetchWalletImage(props: { id: WalletId }) { | ||
| const { getInstalledWalletProviders } = await import( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the async import here? this will ALWAYS be hit when the function is called (not in an optional branch) so it would be more efficient to have it as part of the main bundle regardless
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because this is core, which is imported by react native and i rather not trigger this import unless i import that function if im just grabbing an icon const |
||
| "../../../wallets/injected/mipdStore.js" | ||
| ); | ||
| const mipdImage = getInstalledWalletProviders().find( | ||
| (x) => x.info.rdns === props.id, | ||
| )?.info.icon; | ||
| if (mipdImage) { | ||
| return mipdImage; | ||
| } | ||
| return getWalletInfo(props.id, true); | ||
| } | ||
graphite-app[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question RE async import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer