-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This resolves the issue "Streaks starts at 0" #40
base: main
Are you sure you want to change the base?
Conversation
Hi Harshith, next time use the "closes" format to automatically link the PR to the issue. Also i thought @AadarshM07 was working on this issue? I'll leave the review of the actual change to @ivinjabraham |
Hey @Harshith-2208, I believe you misunderstood Hridesh. He meant put the "closes/fixes/address" keyword in the PR body, not the PR title. |
We really shouldn't be manipulating the data ourselves, we should just use the returned data from Root. |
I have changed the old code with the new i the recent commit, I hope it works.
|
Not quite. The issue is actually in // Handle the streak vector
if member.streak.is_empty() {
// If the streak vector is empty, add a new Streak object with both values set to 1
member.streak.push(Streak {
current_streak: 1,
max_streak: 1,
});
} else {
// Otherwise, increment the current_streak for each Streak and update max_streak if necessary
for streak in &mut member.streak {
streak.current_streak += 1;
if streak.current_streak > streak.max_streak {
streak.max_streak = streak.current_streak;
}
}
} Instead of manually setting the values ourselves, we should just use the values Root returns. |
Closes #36 The issue was "Streaks starts at 0"
I have added an if condition in the status_update.rs file which will check if the streak is less than 1, If satisfied will set the streak to 1. It is satisfied for all members who missed a status update.