Quick fix for longest streak logic
parent
7b42757c9f
commit
30c4085d21
|
@ -289,7 +289,9 @@ exports.returnUser = function(req, res, next) {
|
|||
if (moment(timeKeys[i - 1]).add(1, 'd').toString()
|
||||
=== moment(timeKeys[i]).toString()) {
|
||||
tmpLongest++;
|
||||
user.longestStreak = tmpLongest;
|
||||
if (tmpLongest > user.longestStreak) {
|
||||
user.longestStreak = tmpLongest;
|
||||
}
|
||||
} else {
|
||||
tmpLongest = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue