fix: don't show uptime when offline
This commit is contained in:
parent
03c0bb7b62
commit
7972161abc
1 changed files with 4 additions and 1 deletions
|
|
@ -72,7 +72,10 @@
|
|||
};
|
||||
|
||||
const setUptime = () => {
|
||||
if (!uptimeStart) return;
|
||||
if (!uptimeStart || !online) {
|
||||
uptime = "Offline";
|
||||
return;
|
||||
}
|
||||
const diff = Math.floor((Date.now() - uptimeStart.getTime()) / 1000);
|
||||
const hrs = String(Math.floor(diff / 3600)).padStart(2, "0");
|
||||
const mins = String(Math.floor((diff % 3600) / 60)).padStart(2, "0");
|
||||
|
|
|
|||
Loading…
Reference in a new issue