Reorder creating of testing badges

Need their expiration time to always get refreshed on set so reorder
how they're created to ensure that's the case.
This commit is contained in:
Ehren Kret 2021-09-17 11:26:30 -05:00
parent 009e2eeb97
commit 8f17f45339
1 changed files with 8 additions and 8 deletions

View File

@ -489,6 +489,14 @@ public class ProfileController {
continue;
}
// This is for testing badges and allows them to be added to an account at any time with an expiration of 1 day
// in the future.
BadgeConfiguration badgeConfiguration = badgeConfigurationMap.get(badgeId);
if (badgeConfiguration != null && "testing".equals(badgeConfiguration.getCategory())) {
result.put(badgeId, new AccountBadge(badgeId, clock.instant().plus(Duration.ofDays(1)), true));
continue;
}
// reordering or making visible existing badges
if (existingBadges.containsKey(badgeId)) {
AccountBadge accountBadge = existingBadges.get(badgeId);
@ -496,14 +504,6 @@ public class ProfileController {
accountBadge = new AccountBadge(badgeId, accountBadge.getExpiration(), true);
}
result.put(badgeId, accountBadge);
continue;
}
// This is for testing badges and allows them to be added to an account at any time with an expiration of 1 day
// in the future.
BadgeConfiguration badgeConfiguration = badgeConfigurationMap.get(badgeId);
if (badgeConfiguration != null && "testing".equals(badgeConfiguration.getCategory())) {
result.put(badgeId, new AccountBadge(badgeId, clock.instant().plus(Duration.ofDays(1)), true));
}
}