fix: reward day calculation
This commit is contained in:
@@ -246,7 +246,13 @@ func (s *SadhnaService) Dashboard(ctx context.Context, userID string) (*model.Sa
|
||||
s.ensureGrant(ctx, userID, current)
|
||||
}
|
||||
pending, _ = s.rewards.PendingGrant(ctx, userID)
|
||||
nextReward = nextRewardDate(today, current, todayDone)
|
||||
// Only project a next-gift date when a streak is actually in
|
||||
// progress. With no live streak (current == 0) there's nothing to
|
||||
// "continue", so the calendar shows no gift marker until the devotee
|
||||
// completes a day (full rounds AND a quote).
|
||||
if current > 0 {
|
||||
nextReward = nextRewardDate(today, current, todayDone)
|
||||
}
|
||||
}
|
||||
|
||||
return &model.SadhnaDashboard{
|
||||
|
||||
Reference in New Issue
Block a user