Skip to content

Commit

Permalink
Merge pull request #1894 from ResearchHub/fix-staging-deposits
Browse files Browse the repository at this point in the history
Fix staging deposits
  • Loading branch information
koutst authored Dec 12, 2024
2 parents 8a0a568 + b78a8be commit d54e4f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
4 changes: 4 additions & 0 deletions config/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ export const getCurrServerEnv = (): ENV => {
export const isDevEnv = (): boolean => {
return getCurrServerEnv() === "development";
};

export const isProduction = (): boolean => {
return getCurrServerEnv() === "production";
};
21 changes: 5 additions & 16 deletions pages/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AuthActions } from "../redux/auth";
import { createContext, useEffect, useState } from "react";
import { connect } from "react-redux";
import { HubActions } from "../redux/hub";
import { isDevEnv } from "~/config/utils/env";
import { isDevEnv, isProduction } from "~/config/utils/env";
import { NewPostButtonContext } from "~/components/contexts/NewPostButtonContext.ts";
import { NavigationContextProvider } from "~/components/contexts/NavigationContext";
import { SavedCitationsContextProvider } from "~/components/contexts/SavedCitationsContext";
Expand All @@ -24,7 +24,7 @@ import OrganizationContextProvider from "~/components/contexts/OrganizationConte
import CustomHead from "../components/Head";
import { WagmiConfig, createConfig, configureChains } from "wagmi";
import { createPublicClient, http } from "viem";
import { mainnet } from "wagmi/chains";
import { mainnet, sepolia } from "wagmi/chains";
import {
EthereumClient,
w3mConnectors,
Expand All @@ -51,7 +51,7 @@ LEFT_SIDEBAR_MIN_WIDTH;
const projectId = "a3e8904e258fe256bf772b764d3acfab";

const { chains, publicClient, webSocketPublicClient } = configureChains(
[mainnet],
[isProduction() ? mainnet : sepolia],
[
w3mProvider({ projectId }),
infuraProvider({
Expand All @@ -64,6 +64,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains(
const config = createConfig({
autoConnect: true,
connectors: [
...w3mConnectors({ projectId, chains }),
new MetaMaskConnector({ chains }),
new CoinbaseWalletConnector({
chains,
Expand All @@ -84,13 +85,6 @@ const config = createConfig({
shimDisconnect: true,
},
}),
new InjectedConnector({
chains,
options: {
name: "Injected",
shimDisconnect: true,
},
}),
],
publicClient,
webSocketPublicClient,
Expand All @@ -106,12 +100,7 @@ const DynamicAlertTemplate = dynamic(() =>
const DynamicNavbar = dynamic(() => import("~/components/Navbar"));
export const NavbarContext = createContext();

const wagmiConfig = createConfig({
autoConnect: true,
connectors: w3mConnectors({ projectId, chains }),
publicClient,
});
const ethereumClient = new EthereumClient(wagmiConfig, chains);
const ethereumClient = new EthereumClient(config, chains);

function Base({
auth,
Expand Down

0 comments on commit d54e4f4

Please sign in to comment.