Skip to content

Commit

Permalink
fix governance app error
Browse files Browse the repository at this point in the history
  • Loading branch information
cjinghong committed Apr 30, 2024
1 parent ff03fb3 commit d174f2a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
41 changes: 28 additions & 13 deletions governance/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { useEffect } from "react";
import smoothscroll from "smoothscroll-polyfill";
import "shared/lib/i18n/config";

import {
PhantomWalletAdapter,
SolflareWalletAdapter,
} from "@solana/wallet-adapter-wallets";

import { WalletProvider as SolanaWalletProvider, ConnectionProvider } from "@solana/wallet-adapter-react";
import { SubgraphDataContextProvider } from "shared/lib/hooks/subgraphDataContext";
import RootApp from "./components/RootApp";
import { Web3ContextProvider } from "shared/lib/hooks/web3Context";
Expand All @@ -15,6 +21,7 @@ import TextPreview from "shared/lib/components/TextPreview/TextPreview";
import Geoblocked from "shared/lib/components/Geoblocked/Geoblocked";
import { LoadingText } from "shared/lib/hooks/useLoadingText";
import { allConnectors } from "shared/lib/utils/wallet/connectors";
import { getSolanaClusterURI } from "shared/lib/utils/env";

function App() {
const { loading, rejected } = useGeofence(GeofenceCountry.SINGAPORE);
Expand All @@ -34,19 +41,27 @@ function App() {

return (
<ChainContextProvider>
<Web3ContextProvider>
<Web3ReactProvider connectors={allConnectors}>
<PendingTransactionsContextProvider>
<Web3DataContextProvider>
<SubgraphDataContextProvider>
<ExternalAPIDataContextProvider>
<RootApp />
</ExternalAPIDataContextProvider>
</SubgraphDataContextProvider>
</Web3DataContextProvider>
</PendingTransactionsContextProvider>
</Web3ReactProvider>
</Web3ContextProvider>
<ConnectionProvider endpoint={getSolanaClusterURI()}>
{/* This is just to prevent useWeb3Wallet from breaking */}
<SolanaWalletProvider wallets={[
new PhantomWalletAdapter(),
new SolflareWalletAdapter(),
]} autoConnect={true}>
<Web3ContextProvider>
<Web3ReactProvider connectors={allConnectors}>
<PendingTransactionsContextProvider>
<Web3DataContextProvider>
<SubgraphDataContextProvider>
<ExternalAPIDataContextProvider>
<RootApp />
</ExternalAPIDataContextProvider>
</SubgraphDataContextProvider>
</Web3DataContextProvider>
</PendingTransactionsContextProvider>
</Web3ReactProvider>
</Web3ContextProvider>
</SolanaWalletProvider>
</ConnectionProvider>
</ChainContextProvider>
);
}
Expand Down
1 change: 1 addition & 0 deletions shared/src/hooks/useWeb3Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const useWeb3Wallet = (): Web3WalletData => {
// Remove last connected wallet from local storage so we don't eagerly connect to anything
localStorage.removeItem(LAST_CONNECTED_WALLET_LOCAL_STORAGE_KEY);
} catch (error) {
// eslint-disable-next-line no-console
console.log("Error deactivating", error);
}
}, []);
Expand Down

0 comments on commit d174f2a

Please sign in to comment.