fix: init cpuCores with correct count on first stat tick regardless of consumers

This commit is contained in:
Damocles 2026-04-15 20:06:01 +02:00
parent bc9eda464c
commit d2aacac55c

View file

@ -72,6 +72,13 @@ QtObject {
history: hist.length > histLen ? hist.slice(hist.length - histLen) : hist history: hist.length > histLen ? hist.slice(hist.length - histLen) : hist
}; };
}); });
} else if (root.cpuCores.length !== ev.cores.length) {
// Keep count in sync so panel can size correctly before consumers activate
root.cpuCores = ev.cores.map(c => ({
"usage": c.usage,
"freq_ghz": c.freq_ghz,
"history": []
}));
} }
} else if (ev.type === "temp") { } else if (ev.type === "temp") {
root.tempCelsius = ev.celsius; root.tempCelsius = ev.celsius;