Skip to content

Commit

Permalink
chore: test just disable extension only
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwhiles committed Jan 6, 2025
1 parent 594a8ff commit 8dd60a9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
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

0 comments on commit 8dd60a9

Please sign in to comment.