From 123c515cbb44fa2504d1c91ad8b78e6385a77ee7 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Fri, 22 Nov 2013 23:22:24 -0700 Subject: [PATCH] challenges: only push history for dailies / habits --- src/models/user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/models/user.js b/src/models/user.js index 9b6adc8dc8..4b43142bd3 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -287,7 +287,9 @@ UserSchema.methods.syncScoreToChallenge = function(task, delta){ var t = chal.tasks[task.id]; if (!t) return chal.syncToUser(self); // this task was removed from the challenge, notify user t.value += delta; - t.history.push({value: t.value, date: +new Date}); + if (t.type == 'habit' || t.type == 'daily') { + t.history.push({value: t.value, date: +new Date}); + } chal.save(); }); }