Skip to content

Commit 2b8041d

Browse files
committed
minor fix to show 'ends in' label in the last batch
1 parent 775064d commit 2b8041d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Scheme/CL4R/CL4R.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const CL4R = (props: IProps) => {
5959
const [isLocking, setIsLocking] = React.useState(false);
6060
const [isApprovingToken, setIsApprovingToken] = React.useState(false);
6161
const [currentTime, setCurrentTime] = React.useState(moment().unix());
62-
const isAllowance = data[1].gt(new BN(0));
62+
const isAllowance = data[1]?.gt(new BN(0));
6363
const isEnoughBalance = fromWei(data[2]) >= lockAmount;
6464
const cl4Rlocks = (data as any)[0].data.cl4Rlocks;
6565

@@ -167,7 +167,7 @@ const CL4R = (props: IProps) => {
167167
prefix = "Starts in";
168168
}
169169

170-
if (currentLockingBatch === Number(schemeParams.batchesIndexCap)) {
170+
if (currentLockingBatch + 1 === Number(schemeParams.batchesIndexCap)) {
171171
prefix = "Ends in";
172172
}
173173

0 commit comments

Comments
 (0)