mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 10:40:12 +00:00
fix: bug when huge amount of time was wrongly tracked when application is idle for a long time (e.g. when being on lock screen over several hours)
This commit is contained in:
parent
99b1db9caf
commit
55ee2665a3
1 changed files with 3 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
const IPC_EVENT_CURRENT_TASK_UPDATED = 'CHANGED_CURRENT_TASK';
|
||||
const IPC_EVENT_IDLE_TIME = 'IDLE_TIME';
|
||||
const MAX_TRACKING_PERIOD_VAL = 60000;
|
||||
|
||||
class TimeTracking {
|
||||
/* @ngInject */
|
||||
|
|
@ -45,7 +46,8 @@
|
|||
let realPeriodDuration = moment.duration(now.diff(currentTrackingStart))
|
||||
.asMilliseconds();
|
||||
|
||||
if (!this.isIdle) {
|
||||
// only track if not idle and interval is smaller than threshold
|
||||
if (!this.isIdle && realPeriodDuration <= MAX_TRACKING_PERIOD_VAL) {
|
||||
this.Tasks.addTimeSpent(this.$rootScope.r.currentTask, realPeriodDuration);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue