diff --git a/src/app/pages/detail/detail.component.ts b/src/app/pages/detail/detail.component.ts index ee58f8e..ad8df9a 100644 --- a/src/app/pages/detail/detail.component.ts +++ b/src/app/pages/detail/detail.component.ts @@ -24,9 +24,15 @@ export class DetailComponent extends BasePageComponent implements AfterViewInit hours: '00' }; } - const now = new Date(); - const elapsedMilliseconds = now.getTime() - startedAt.getTime(); + + let elapsedMilliseconds = now.getTime() - startedAt.getTime(); + + if (elapsedMilliseconds < 0) { + console.warn("Elapsed time is negative"); + this.daemonService.startedAt = now; + elapsedMilliseconds = 0; + } const seconds = Math.floor((elapsedMilliseconds / 1000) % 60); const minutes = Math.floor((elapsedMilliseconds / (1000 * 60)) % 60);