Skip to content
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

chore: attempt to fix faucet issues #1792

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions src/components/Faucet/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -92,7 +97,7 @@ export default function Hero({
styles.hero,
network === "linea" && styles.linea,
network === "sepolia" && styles.sepolia,
className,
className
)}
>
{!(isExtensionActive && metaMaskAccount) && <EthIcon />}
Expand Down Expand Up @@ -136,7 +141,7 @@ export default function Hero({
)}
<div
className={clsx(
!!Object.keys(projects).length && styles.alignedButtons,
!!Object.keys(projects).length && styles.alignedButtons
)}
>
{!isExtensionActive ? (
Expand Down
26 changes: 13 additions & 13 deletions src/theme/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,28 @@ interface IMetamaskProviderContext {
export const MetamaskProviderContext = createContext<IMetamaskProviderContext>({
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({
Expand All @@ -105,7 +105,7 @@ const sdk = new MetaMaskSDK({
extensionOnly: true,
checkInstallationImmediately: false,
logging: {
sdk: false,
sdk: true,
},
});

Expand Down Expand Up @@ -173,7 +173,7 @@ export const LoginProvider = ({ children }) => {
const provider = sdk.getProvider();
setMetaMaskProvider(provider);
}
} catch (e) {}
} catch (e) { }
};

const metaMaskWalletIdConnectHandler = useCallback(async () => {
Expand Down
Loading