Skip to content

Commit

Permalink
Fix Daily Rewards Section (#1970)
Browse files Browse the repository at this point in the history
* update reset logic

* update yarn.lock
  • Loading branch information
corlard3y authored Nov 14, 2024
1 parent f769f86 commit 8329a7d
Show file tree
Hide file tree
Showing 2 changed files with 1,116 additions and 1,248 deletions.
16 changes: 14 additions & 2 deletions src/modules/rewards/hooks/useDailyRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,20 @@ const useDailyRewards = () => {
}
}

setActiveDay(newDay);
setActiveItem(newDayData);
// first day data after completing all 7
const firstDayData = dailyRewardsActivities?.find(
(activity) => activity.activityType === `daily_check_in_7_days_day1`
);

// if active day is complete, reset to first day, if not use the next day
if (newDay <= 7) {
setActiveDay(newDay);
setActiveItem(newDayData);
} else {
setActiveDay(1);
setActiveItem(firstDayData);
}

setIsLoadingRewards(false);
}, [sendRecentActivities]);

Expand Down
Loading

0 comments on commit 8329a7d

Please sign in to comment.