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