From 1b854b41b5e37f5a89cfe85bbdde76dbd5f4f776 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Sat, 4 Feb 2017 21:57:02 +0100 Subject: [PATCH] fix time not being tracked correctly --- app/scripts/main/global-services/tasks-s.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/scripts/main/global-services/tasks-s.js b/app/scripts/main/global-services/tasks-s.js index 7c6584c668..bc80a45c06 100644 --- a/app/scripts/main/global-services/tasks-s.js +++ b/app/scripts/main/global-services/tasks-s.js @@ -43,7 +43,7 @@ TakeABreakReminder.check(timeSpentInMs, idleTimeInMs); // track - this.addTimeSpent(that.$localStorage.currentTask, timeSpentInMs); + that.addTimeSpent(that.$localStorage.currentTask, timeSpentInMs); // we need to manually call apply as that is an outside event that.$rootScope.$apply(); @@ -61,7 +61,7 @@ if (!isIdleDialogOpen) { isIdleDialogOpen = true; - this.Dialogs('WAS_IDLE', { idleTime, minIdleTimeInMs }) + that.Dialogs('WAS_IDLE', { idleTime, minIdleTimeInMs }) .then(() => { // if tracked TakeABreakReminder.isShown = true; @@ -69,7 +69,7 @@ }, () => { // if not tracked // unset currentSession.timeWorkedWithoutBreak - this.$localStorage.currentSession.timeWorkedWithoutBreak = undefined; + that.$localStorage.currentSession.timeWorkedWithoutBreak = undefined; TakeABreakReminder.isShown = true; isIdleDialogOpen = false; }); @@ -396,6 +396,7 @@ timeSpentInMs = timeSpentInMsOrMomentDuration; } + // if not set set started pointer if (!task.started) { task.started = moment();