Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Fix check and return instant kit can be redeemed
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchy50 authored and dualspiral committed Jan 14, 2021
1 parent 34e1d27 commit 42529de
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public CompletableFuture<Boolean> isRedeemable(Kit kit, User user) {
@Override
public CompletableFuture<Optional<Instant>> getCooldownExpiry(Kit kit, User user) {
return redeemTime(kit.getName(), user).thenApply(x -> {
if (x.isPresent()) {
if (x.isPresent() && kit.getCooldown().isPresent()) {
x = Optional.of(x.get().plus(kit.getCooldown().get()));
if (x.get().isAfter(Instant.now())) {
return x;
}
Expand Down

0 comments on commit 42529de

Please sign in to comment.