Only update hardware stats when necessary (#73)

This commit is contained in:
Maciej Hirsz
2018-10-01 14:10:54 +02:00
committed by GitHub
parent 76e9155823
commit 717c5a3ac9
10 changed files with 81 additions and 24 deletions
@@ -58,8 +58,8 @@ function Truncate(props: { text: string, position?: 'left' | 'right' | 'center'
function formatStamp(stamp: Types.Timestamp): string {
const passed = (timestamp() - stamp) / 1000 | 0;
const hours = Math.round(passed / 3600);
const minutes = Math.round((passed % 3600) / 60);
const hours = passed / 3600 | 0;
const minutes = (passed % 3600) / 60 | 0;
const seconds = (passed % 60) | 0;
return hours ? `${hours}h ago`