Bump weekly-watch auto claim interval (#1794)

## Ticket
1768 Check reward claiming logic

## Change
- Bump to >6.5 days
- Remove unnecessary `Math.ceil` -- not sure why I added that. It was causing diff to hit earlier than necessary.

> _and I'm 5 days away._

Not sure how to replicate/explain this, though -- the old code would have still covered this range.  One possibility is when `last_claimed` is not defined, where we assume user hasn't claimed yet. We could flip this to assume "claimed" and just let the user manually claim as the fallback -- let me know.
This commit is contained in:
infinite-persistence 2022-07-05 18:44:40 +08:00 committed by GitHub
parent 6696d32e66
commit 02d017d415
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,8 +77,8 @@ export const selectWeeklyWatchClaimedThisWeek = createSelector(selectUnclaimedRe
if (weeklyWatch && weeklyWatch.data && weeklyWatch.data.last_claimed) { if (weeklyWatch && weeklyWatch.data && weeklyWatch.data.last_claimed) {
const last = new Date(weeklyWatch.data.last_claimed); const last = new Date(weeklyWatch.data.last_claimed);
const diff = new Date() - last; const diff = new Date() - last;
const diffDays = Math.ceil(diff / (1000 * 60 * 60 * 24)); const diffDays = diff / (1000 * 60 * 60 * 24);
return diffDays < 6; return diffDays < 6.5;
} }
return false; return false;
}); });