fix time not being tracked correctly

This commit is contained in:
Johannes Millan 2017-02-04 21:57:02 +01:00
parent eabfe357f0
commit 1b854b41b5

View file

@ -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();