Skip to content

Commit

Permalink
Update CreateVestingBalance.jsx
Browse files Browse the repository at this point in the history
small bug fixes
  • Loading branch information
grctest committed Sep 13, 2024
1 parent 4cef990 commit 0801d1c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/CreateVestingBalance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,16 @@ export default function CreateVestingBalance(properties) {
const chosenAssetBalance = useMemo(() => {
if (usrBalances && assetData) {
const found = usrBalances.find((_balance) => _balance.asset_id === assetData.id);
if (!found) {
return 0;
}
const assetBalance = humanReadableFloat(found.amount, assetData.precision);
return assetBalance;
}
}, [usrBalances, assetData]);

// ccd & lvc
const [beginDateTime, setBeginDateTime] = useState(0); // date time picked date
const [beginDateTime, setBeginDateTime] = useState();

// ccd policy
const [vestingSeconds, setVestingSeconds] = useState(0);
Expand Down Expand Up @@ -408,11 +411,11 @@ export default function CreateVestingBalance(properties) {
},
policy: policy === "ccd"
? [1, {
start_claim: Math.floor(beginDateTime.getTime()),
start_claim: Math.floor(beginDateTime.getTime()) / 1000,
vesting_seconds: parseInt(vestingSeconds)
}]
: [0, {
begin_timestamp: Math.floor(beginDateTime.getTime()),
begin_timestamp: Math.floor(beginDateTime.getTime()) / 1000,
vesting_cliff_seconds: parseInt(vestingCliffSeconds),
vesting_duration_seconds: parseInt(vestingDurationSeconds)
}]
Expand Down

0 comments on commit 0801d1c

Please sign in to comment.