Quick fix for longest streak logic

pull/427/head
terakilobyte 2015-05-05 20:03:27 -04:00
parent 7b42757c9f
commit 30c4085d21
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}