Skip to content

Commit

Permalink
fix amount
Browse files Browse the repository at this point in the history
  • Loading branch information
crystalbit committed Apr 28, 2024
1 parent cb8e8bf commit 6d1407d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/src/pages/claim-flt-page/claim-flt-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import supportedChains from "../../constants/chains";
export const ClaimFltPage = memo(() => {
const { address, provider, network } = useWeb3Connection();
const [amountAndDate, setAmountAndDate] = useState(null);
const [rawAmount, setRawAmount] = useState(null);
const [secondsLeft, setSecondsLeft] = useState(null);

useEffect(() => {
Expand Down Expand Up @@ -54,6 +55,7 @@ export const ClaimFltPage = memo(() => {
const data = await contract.functions.lockedBalances(address);
const { amount, unlockTime } = data;
const _amount = +ethers.utils.formatEther(amount);
setRawAmount(amount);
const _unlockTime = new Date(unlockTime.toNumber() * 1000);
setAmountAndDate({ amount: _amount, unlockTime: _unlockTime });
}
Expand All @@ -73,7 +75,7 @@ export const ClaimFltPage = memo(() => {
provider.getSigner(),
);
setWaitForSigning(true);
const response = await contract.functions.transfer(address, amountAndDate.amount, { from: address });
const response = await contract.functions.transfer(address, rawAmount, { from: address });
setWaitForSigning(false);
setWaitForReceipt(true);
const receipt = await response.wait();
Expand Down

0 comments on commit 6d1407d

Please sign in to comment.