Skip to content

Commit

Permalink
chore: remove currentChain logic
Browse files Browse the repository at this point in the history
  • Loading branch information
filoozom committed Sep 30, 2023
1 parent 38a04cb commit 171f338
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// React
import React, { useState, useEffect, useMemo } from "react";
import React, { useState, useEffect } from "react";
// Ethers

import { Web3NetworkSwitch, useWeb3Modal, Web3Button } from "@web3modal/react";
import { useAccount, useBalance, usePublicClient } from "wagmi";
import { useAccount, useBalance } from "wagmi";

import {
useUserReservesBalance,
Expand All @@ -29,14 +29,12 @@ export const Home = () => {
// ------------ Refs -------------

const { address, isConnected } = useAccount();
const client = usePublicClient();

// ------------ States -------------

/** @notice Opens connect button modal */
const { close } = useWeb3Modal();

const [currentChain, setCurrentChain] = useState<string>("");
//card-1
const sharesBalance = useBalance({ token: ERC4626_VAULT_ADDRESS, address });
//card-2
Expand All @@ -47,10 +45,6 @@ export const Home = () => {
const { dripRate, lastClaimTimestamp } = useReceiverData();
const [sharesValue, setSharesValue] = useState<bigint>(BigInt(0));

useEffect(() => {
if (client.key !== currentChain) setCurrentChain(client.key);
}, [address, client.key, currentChain]);

/** @notice Escape from connect modal */
document.addEventListener("keydown", e => {
if (e.key === "Escape") {
Expand Down

0 comments on commit 171f338

Please sign in to comment.