diff --git a/src/components/Faucet/Hero.tsx b/src/components/Faucet/Hero.tsx index 6c13fc03855..7e3e451c63a 100644 --- a/src/components/Faucet/Hero.tsx +++ b/src/components/Faucet/Hero.tsx @@ -40,16 +40,21 @@ export default function Hero({ const [isWalletLinking, setIsWalletLinking] = useState(false); const handleConnectWallet = () => { - setIsWalletLinking(true); - trackClickForSegment({ - eventName: !isExtensionActive ? "Install MetaMask" : "Connect MetaMask", - clickType: "Hero", - userExperience: "B", - responseStatus: null, - responseMsg: null, - timestamp: Date.now(), - }); - metaMaskWalletIdConnectHandler(); + try { + setIsWalletLinking(true); + trackClickForSegment({ + eventName: !isExtensionActive ? "Install MetaMask" : "Connect MetaMask", + clickType: "Hero", + userExperience: "B", + responseStatus: null, + responseMsg: null, + timestamp: Date.now(), + }); + metaMaskWalletIdConnectHandler(); + } catch (error) { + console.error("Wallet connection error:", error); + throw error; + } }; const handleLinkWallet = () => { @@ -92,7 +97,7 @@ export default function Hero({ styles.hero, network === "linea" && styles.linea, network === "sepolia" && styles.sepolia, - className, + className )} > {!(isExtensionActive && metaMaskAccount) && } @@ -136,7 +141,7 @@ export default function Hero({ )}
{!isExtensionActive ? ( diff --git a/src/theme/Root.tsx b/src/theme/Root.tsx index 72ad09b1feb..5bf43e50f0c 100644 --- a/src/theme/Root.tsx +++ b/src/theme/Root.tsx @@ -72,28 +72,28 @@ interface IMetamaskProviderContext { export const MetamaskProviderContext = createContext({ token: undefined, projects: {}, - setProjects: () => {}, - metaMaskDisconnect: () => new Promise(() => {}), - metaMaskWalletIdConnectHandler: () => new Promise(() => {}), + setProjects: () => { }, + metaMaskDisconnect: () => new Promise(() => { }), + metaMaskWalletIdConnectHandler: () => new Promise(() => { }), userId: undefined, metaMaskAccount: undefined, metaMaskAccountEns: undefined, - setMetaMaskAccount: () => {}, + setMetaMaskAccount: () => { }, uksTier: undefined, metaMaskProvider: undefined, - setMetaMaskProvider: () => {}, + setMetaMaskProvider: () => { }, sdk: undefined, - setNeedsMfa: () => {}, + setNeedsMfa: () => { }, needsMfa: false, - setWalletLinked: () => {}, + setWalletLinked: () => { }, walletLinked: undefined, - setWalletAuthUrl: () => {}, + setWalletAuthUrl: () => { }, walletAuthUrl: "", userAPIKey: "", - setUserAPIKey: () => {}, - fetchLineaEns: () => new Promise(() => {}), + setUserAPIKey: () => { }, + fetchLineaEns: () => new Promise(() => { }), userEncPublicKey: undefined, - setUserEncPublicKey: () => {}, + setUserEncPublicKey: () => { }, }); const sdk = new MetaMaskSDK({ @@ -105,7 +105,7 @@ const sdk = new MetaMaskSDK({ extensionOnly: true, checkInstallationImmediately: false, logging: { - sdk: false, + sdk: true, }, }); @@ -173,7 +173,7 @@ export const LoginProvider = ({ children }) => { const provider = sdk.getProvider(); setMetaMaskProvider(provider); } - } catch (e) {} + } catch (e) { } }; const metaMaskWalletIdConnectHandler = useCallback(async () => {