Skip to content

Commit

Permalink
Merge pull request #26 from fluencelabs/claim_flt_page
Browse files Browse the repository at this point in the history
fix: amount
  • Loading branch information
crystalbit authored Apr 28, 2024
2 parents 18f2d13 + 6d1407d commit 2e086ac
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 2e086ac

Please sign in to comment.