Skip to content

Commit

Permalink
fix an issue that messes up total time when completed tasks are deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
drecodeam committed Jul 19, 2018
1 parent a712d3d commit d1227d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class HomeComponent implements OnInit {
markItemComplete( task ) {
task.isTicked = true;
this.totalTime = this.totalTime - ( task.time - task.elapsed );
this.currentTaskID = 0;
this.currentTaskID = 0;
this.updateEta();
this.updateData();
}
Expand All @@ -156,9 +156,11 @@ export class HomeComponent implements OnInit {
list.splice( index, 1 );
}
});
this.totalTime = this.totalTime - ( task.time - task.elapsed );
this.updateEta();
this.updateData();
if ( !task.isTicked ) {
this.totalTime = this.totalTime - ( task.time - task.elapsed );
this.updateEta();
this.updateData();
}
}

/**
Expand Down

0 comments on commit d1227d2

Please sign in to comment.