diff --git a/Mohem/src/app/attendance-tracking/home/home.component.ts b/Mohem/src/app/attendance-tracking/home/home.component.ts index aa8ca30b..cf572606 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.ts +++ b/Mohem/src/app/attendance-tracking/home/home.component.ts @@ -99,8 +99,11 @@ export class HomeComponent implements OnInit { this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':')); this.isCheckedIn = this.spentHours === 0 ? false : true; - if (this.isCheckedIn) { + if (this.isCheckedIn && this.remainingTime != 0) { this.initTimer(); + } else if (this.isCheckedIn && this.remainingTime === 0) { + this.displayTime = '00:00:00'; + this.percent = 100; } } diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index f7c64378..5a84eeae 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -580,8 +580,10 @@ convertAndAssignTime(data) { this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':')); this.isCheckedIn = this.spentHours === 0 ? false : true; - if (this.isCheckedIn) { + if (this.isCheckedIn && this.remainingTime != 0) { this.initTimer(); + } else if (this.isCheckedIn && this.remainingTime === 0) { + this.percent = 100; } }