Skip to content

Commit

Permalink
Revert "Removed achieved badges check to update balances for each use…
Browse files Browse the repository at this point in the history
…r" (#34)
  • Loading branch information
ice-myles authored Dec 20, 2023
1 parent 13bc66d commit 50f9a87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion badges/achieve_badges.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ func (s *balancesTableSource) upsertProgress(ctx context.Context, balance int64,
return errors.Wrap(ctx.Err(), "context failed")
}
pr, err := s.getProgress(ctx, userID, true)
if err != nil && !errors.Is(err, storage.ErrRelationNotFound) {
if err != nil && !errors.Is(err, storage.ErrRelationNotFound) ||
(pr != nil && pr.AchievedBadges != nil && (len(*pr.AchievedBadges) == len(&AllTypes) || IsBadgeGroupAchieved(pr.AchievedBadges, CoinGroupType))) {
return errors.Wrapf(err, "failed to getProgress for userID:%v", userID)
}
if pr != nil && pr.Balance == balance {
Expand Down

0 comments on commit 50f9a87

Please sign in to comment.