Skip to content

Commit

Permalink
fix(ui): max num of confirmation for ETH - 65 (#808)
Browse files Browse the repository at this point in the history
* fix(ui): max num of confirmation for ETH - 65

* lint

* lint

* lint
  • Loading branch information
thedoublejay authored Mar 23, 2023
1 parent 362f6fa commit 17ce54e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { useEffect } from "react";
import BigNumber from "bignumber.js";
import BridgeForm from "@components/BridgeForm";
import WelcomeHeader from "@components/WelcomeHeader";
import MobileBottomMenu from "@components/MobileBottomMenu";
import useWatchEthTxn from "@hooks/useWatchEthTxn";
import TransactionStatus from "@components/TransactionStatus";
import { useStorageContext } from "@contexts/StorageContext";
import Logging from "@api/logging";
import { CONFIRMATIONS_BLOCK_TOTAL } from "../constants";
import { getStorageItem } from "@utils/localStorage";
import {
CONFIRMATIONS_BLOCK_TOTAL,
EVM_CONFIRMATIONS_BLOCK_TOTAL,
} from "../constants";
import useBridgeFormStorageKeys from "../hooks/useBridgeFormStorageKeys";
import { getStorageItem } from "../utils/localStorage";

function Home() {
const { ethTxnStatus, dfcTxnStatus, isApiSuccess } = useWatchEthTxn();
Expand All @@ -34,7 +38,10 @@ function Home() {
}, [UNCONFIRMED_TXN_HASH_KEY, UNSENT_FUND_TXN_HASH_KEY]);

const getNumberOfConfirmations = () => {
let numOfConfirmations = ethTxnStatus?.numberOfConfirmations;
let numOfConfirmations = BigNumber.min(
ethTxnStatus?.numberOfConfirmations,
EVM_CONFIRMATIONS_BLOCK_TOTAL
).toString();

if (txnHash.confirmed !== undefined || txnHash.unsentFund !== undefined) {
numOfConfirmations = CONFIRMATIONS_BLOCK_TOTAL.toString();
Expand Down

0 comments on commit 17ce54e

Please sign in to comment.