Skip to content

Commit

Permalink
feat: apply diamond to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunny authored and Sunny committed Oct 2, 2023
1 parent bd43fae commit 93adf09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/dapp/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ethers } from "ethers";
import { FC, useState } from "react";
import "@uniswap/widgets/fonts.css";

import useManagerManaged from "@/components/lib/hooks/contracts/use-manager-managed";
import useProtocolContracts from "@/components/lib/hooks/contracts/use-protocol-contracts";
import useEffectAsync from "@/components/lib/hooks/use-effect-async";
import DollarPrice from "@/components/redeem/dollar-price";
import { fetchData } from "@/components/utils/local-data";
Expand All @@ -12,21 +12,21 @@ const WalletConnectionWall = dynamic(() => import("@/components/ui/wallet-connec

const index: FC = (): JSX.Element => {
const [twapPrice, setTwapPrice] = useState<ethers.BigNumber | null>(null);
const managedContracts = useManagerManaged();
const protocolContracts = useProtocolContracts();

useEffectAsync(async () => {
if (managedContracts != null) {
if (protocolContracts != null) {
try {
console.log(twapPrice, "priced in ");
} catch (error) {
console.log("Error occurred while executing contract call", error);
setTwapPrice(null);
}
} else {
console.log("managedContracts is null");
console.log("protocolContracts is null");
setTwapPrice(null);
}
}, [managedContracts]);
}, [protocolContracts]);

if (process.env.DEBUG === "true") {
fetchData();
Expand Down

0 comments on commit 93adf09

Please sign in to comment.