Skip to content

Commit

Permalink
stake fixes (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandpo committed Aug 2, 2023
1 parent 709d493 commit 70a322f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/components/vote-escrow/LockupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const LockupForm: FunctionComponent<LockupFormProps> = ({ existingLockup }) => {
approvalStatus === "waiting-for-network";

const actionDisabledExistingLockup =
lockupDuration < 1 ||
lockupDuration <=
Math.floor((existingLockup?.end - blockTimestamp) / SECONDS_IN_A_MONTH) ||
lockupStatus === "waiting-for-user" ||
Expand Down Expand Up @@ -409,7 +410,11 @@ const LockupForm: FunctionComponent<LockupFormProps> = ({ existingLockup }) => {
max={formattedOgvBalance}
value={lockupAmount}
onChange={(e) => {
setLockupAmount(e.target.value);
setLockupAmount(
e.target.value === formattedOgvBalance
? ethers.utils.formatUnits(balances.ogv.toString())
: e.target.value
);
}}
markers={lockupAmountInputMarkers}
onMarkerClick={(markerValue) => {
Expand All @@ -428,7 +433,7 @@ const LockupForm: FunctionComponent<LockupFormProps> = ({ existingLockup }) => {
counterUnit="months"
min={"0"}
max={maxLockupDurationInMonths}
value={lockupDuration}
value={Number(lockupDuration) >= 0 ? lockupDuration : 0}
onChange={(e) => {
setLockupDuration(e.target.value);
}}
Expand Down

0 comments on commit 70a322f

Please sign in to comment.