8000 fix: amount by crystalbit · Pull Request #26 · fluencelabs/dao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: amount #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 });
}
5EAF 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
Loading
0