Skip to content

Commit

Permalink
fix: show current date if vault drip date less then now (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
sol-mocha authored Aug 18, 2022
1 parent 4e5058f commit b5bdb53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/component/PositionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ export function PositionCard({ position }: PositionCardProps) {

const estimatedNextDripDate = useMemo(() => {
if (!vault) return undefined;

return new Date(vault.dripActivationTimestamp.toNumber() * 1e3);
const vaultDripActivationDate = new Date(vault.dripActivationTimestamp.toNumber() * 1e3);
if (vaultDripActivationDate < new Date()) {
return new Date();
}
return vaultDripActivationDate;
}, [vault]);

const positonIsDoneDripping = estimatedEndDate === '-';
Expand Down

0 comments on commit b5bdb53

Please sign in to comment.