fix(webui/overview): drop zero-count stats from health hero when nothing is tracked

With no apps tracked the sub line read '0 apps tracked · 0/0 backed up ·
last scan …' — pure noise. Show only the scan time in that case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-07-12 22:28:18 +01:00
parent 574aaad565
commit 0651dee155

View File

@ -342,10 +342,16 @@ class OverviewManager {
let sub;
if (scanned) {
const checked = u.lastChecked ? this.updater.fmtRel(u.lastChecked) : 'never';
const bits = [`${u.apps} app${u.apps === 1 ? '' : 's'} tracked`];
if (this.backup) bits.push(`${b.protectedLabel} backed up`);
bits.push(`last scan ${checked}`);
sub = bits.join(' · ');
if (!u.apps) {
// Nothing tracked yet — the counts ("0 apps tracked · 0/0 backed up")
// are just noise, so show only the scan time.
sub = `last scan ${checked}`;
} else {
const bits = [`${u.apps} app${u.apps === 1 ? '' : 's'} tracked`];
if (this.backup) bits.push(`${b.protectedLabel} backed up`);
bits.push(`last scan ${checked}`);
sub = bits.join(' · ');
}
} else {
sub = 'The first automatic scan runs within a couple of minutes — or hit Check now.';
}