Skip to content

Commit

Permalink
Fix import statements and add missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennievon committed Aug 13, 2024
1 parent a369f72 commit 421af27
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/src/bridge/frontend/pages/transactions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
TabsList,
TabsTrigger,
} from "@/src/components/ui/tabs";
import { useWalletStore } from "@/src/components/providers/wallet-provider";
import { useContract } from "@/src/hooks/useContract";
import useWalletStore from "@/src/stores/wallet-store";

export const metadata: Metadata = {
title: "Transactions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export default function Dashboard() {
setLoading(false);
}
},
[address, token]
// eslint-disable-next-line react-hooks/exhaustive-deps
[address, token, tokens, receiver, fromTokenBalance]
);

const setAmount = React.useCallback(
Expand All @@ -123,7 +124,8 @@ export default function Dashboard() {
const amount = Math.floor(((fromTokenBalance * value) / 100) * 100) / 100;
setValue("amount", amount.toString());
},
[form, fromTokenBalance]
// eslint-disable-next-line react-hooks/exhaustive-deps
[fromTokenBalance, token]
);

const handleSwitchNetwork = React.useCallback(
Expand Down Expand Up @@ -151,6 +153,7 @@ export default function Dashboard() {
React.useEffect(() => {
const storedReceiver = handleStorage.get("tenBridgeReceiver");
setValue("receiver", storedReceiver ? storedReceiver : address);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [address]);

React.useEffect(() => {
Expand All @@ -174,12 +177,23 @@ export default function Dashboard() {
fetchTokenBalance(selectedToken);
}
}
}, [fromChain, token, amount, receiver, provider, isL1ToL2, walletConnected]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
fromChain,
token,
amount,
receiver,
provider,
isL1ToL2,
walletConnected,
address,
]);

React.useEffect(() => {
setValue("fromChain", isL1ToL2 ? L1CHAINS[0].value : L2CHAINS[0].value);
setValue("toChain", isL1ToL2 ? L2CHAINS[0].value : L1CHAINS[0].value);
setValue("token", isL1ToL2 ? L1TOKENS[0].value : L2TOKENS[0].value);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isL1ToL2]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const WalletProvider = ({ children }: WalletConnectionProviderProps) => {

useEffect(() => {
restoreWalletState();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const value = {};
Expand Down

0 comments on commit 421af27

Please sign in to comment.