mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2025-01-23 19:15:54 +00:00
Fix negative time elapsed
This commit is contained in:
parent
b8dceec47d
commit
13a4bb2237
1 changed files with 8 additions and 2 deletions
|
@ -24,9 +24,15 @@ export class DetailComponent extends BasePageComponent implements AfterViewInit
|
||||||
hours: '00'
|
hours: '00'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = new Date();
|
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 seconds = Math.floor((elapsedMilliseconds / 1000) % 60);
|
||||||
const minutes = Math.floor((elapsedMilliseconds / (1000 * 60)) % 60);
|
const minutes = Math.floor((elapsedMilliseconds / (1000 * 60)) % 60);
|
||||||
|
|
Loading…
Reference in a new issue