Skip to content

Commit

Permalink
fix(core): fix connect wallet button thats not working
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Aug 22, 2023
1 parent a8153ef commit 0b9a279
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/web/src/layouts/Base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { configureChains, createConfig, WagmiConfig } from "wagmi";
import { sepolia, mainnet } from "wagmi/chains";
import { MetaMaskConnector } from "wagmi/connectors/metaMask";
import { InjectedConnector } from "wagmi/connectors/injected";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
import { publicProvider } from "wagmi/providers/public";
import { ConnectKitProvider, getDefaultConfig } from "connectkit";
Expand All @@ -33,6 +34,14 @@ import { ETHEREUM_MAINNET_ID } from "../constants";
import { MAINNET_CONFIG, TESTNET_CONFIG } from "../config";
import { QueueStorageProvider } from "./contexts/QueueStorageContext";

/**
* TODO (lyka): remove unnecessary `InjectedConnector` once issue is resolved
* bug ticket: https://github.com/family/connectkit/issues/294
*/
const injected = new InjectedConnector({
chains: [mainnet, sepolia],
});

const metamask = new MetaMaskConnector({
chains: [mainnet, sepolia],
});
Expand All @@ -58,7 +67,7 @@ const config = createConfig(
autoConnect: true,
chains,
appName,
connectors: [metamask],
connectors: [metamask, injected],
walletConnectProjectId:
process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?? "",
}),
Expand Down

0 comments on commit 0b9a279

Please sign in to comment.