Skip to content

Commit 79b2c80

Browse files
committed
revert date +1 buffer on claim
1 parent fce2586 commit 79b2c80

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/lib/components/ClaimRewards.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
1919
const now = +new Date();
2020
$: unstaking = WharfService.pendingClaimableBalances().filter(x => !x.savings).map(x => {
21-
const datePlusOneDay = new Date(+new Date(x.date) + 86400000);
2221
return [
2322
`${parseFloat(parseFloat(WharfService.convertRexToEos(parseFloat(x.rex.toString())).toString()).toFixed(4))} EOS`,
24-
datePlusOneDay.toDateString()];
23+
x.date.toDateString()];
2524
}).sort((a, b) => +new Date(a[1]) - +new Date(b[1]));
2625
2726
$: totalUnstaking = $unstakingBalances.filter(x => !x.savings).reduce((acc, x) => parseFloat(parseFloat((acc + parseFloat(x.rex.toString())).toString()).toFixed(4)), 0);

src/lib/wharf.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,15 @@ export default class WharfService {
307307

308308
static pendingClaimableBalances(){
309309
const now = +new Date();
310-
311310
return get(unstakingBalances).filter(x => {
312-
let datePlusOneDayAtMidnight = +new Date(+x.date + 1000 * 60 * 60 * 24);
313-
return datePlusOneDayAtMidnight >= now;
311+
return +x.date >= now;
314312
});
315313
}
316314

317315
static claimableBalances(){
318316
const now = +new Date();
319317
return get(unstakingBalances).filter(x => {
320-
let datePlusOneDayAtMidnight = +new Date(+x.date + 1000 * 60 * 60 * 24);
321-
return datePlusOneDayAtMidnight < now;
318+
return +x.date < now;
322319
});
323320
}
324321

0 commit comments

Comments
 (0)