fix break current stream
This commit is contained in:
@ -11,6 +11,8 @@ function calcCurrentStreak(cals) {
|
|||||||
let streakBroken = false;
|
let streakBroken = false;
|
||||||
const lastDayInStreak = revCals
|
const lastDayInStreak = revCals
|
||||||
.reduce((current, cal, index) => {
|
.reduce((current, cal, index) => {
|
||||||
|
debug('cal', cal);
|
||||||
|
debug('broken', streakBroken);
|
||||||
const before = revCals[index === 0 ? 0 : index - 1];
|
const before = revCals[index === 0 ? 0 : index - 1];
|
||||||
if (
|
if (
|
||||||
!streakBroken &&
|
!streakBroken &&
|
||||||
@ -18,6 +20,7 @@ function calcCurrentStreak(cals) {
|
|||||||
) {
|
) {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
streakBroken = true;
|
||||||
return current;
|
return current;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user