Skip to content

Commit e5c9f93

Browse files
committed
fix: set correct type of icon url passed to Metamask SDK
1 parent 477de11 commit e5c9f93

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/no-modal/src/connectors/metamask-connector/metamaskConnector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class MetaMaskConnector extends BaseEvmConnector<void> {
8484
const appMetadata: MetaMaskSDKOptions["dappMetadata"] = {
8585
name: getSiteName(window) || "web3auth",
8686
url: window.location.origin || "https://web3auth.io",
87-
iconUrl,
87+
iconUrl: iconUrl ?? undefined,
8888
};
8989

9090
// initialize the MetaMask SDK

packages/no-modal/src/connectors/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function imgExists(url: string): Promise<boolean> {
4444
/**
4545
* Extracts an icon for the site from the DOM
4646
*/
47-
export async function getSiteIcon(window: Window): Promise<string | null> {
47+
export async function getSiteIcon(window: Window): Promise<string | undefined> {
4848
const { document } = window;
4949

5050
// Use the site's favicon if it exists
@@ -59,7 +59,7 @@ export async function getSiteIcon(window: Window): Promise<string | null> {
5959
return icon.href;
6060
}
6161

62-
return null;
62+
return undefined;
6363
}
6464

6565
export function parseToken<T>(token: string): { header: { alg: string; typ: string; kid?: string }; payload: T } {

0 commit comments

Comments
 (0)