fix dateCompleted not remove from un-completed todos and fix tasks test

This commit is contained in:
Matteo Pagliazzi
2016-01-18 15:01:46 +01:00
parent d93cabafb9
commit ee854229c7
5 changed files with 5 additions and 65 deletions

View File

@@ -224,7 +224,7 @@ export default function scoreTask (options = {}, req = {}) {
if (cron) { // don't touch stats on cron
delta += _changeTaskValue(user, task, direction, times, cron);
} else {
if (direction === 'up') task.dateCompleted = new Date();
task.dateCompleted = direction === 'up' ? new Date() : undefined;
delta += _changeTaskValue(user, task, direction, times, cron);
if (direction === 'down') delta = _calculateDelta(task, direction, delta); // recalculate delta for unchecking so the gp and exp come out correctly