Fix: enforce max field blocks for esp home widget (#5951)

This commit is contained in:
shamoon 2025-11-08 12:32:41 -08:00 committed by GitHub
parent 3ef7031eb0
commit afc0fe29ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,12 @@ export default function Component({ service }) {
return <Container service={service} error={resultError} />;
}
if (!widget.fields || widget.fields.length === 0) {
widget.fields = ["online", "offline", "offline_alt", "total"];
} else if (widget.fields.length > 4) {
widget.fields = widget.fields.slice(0, 4);
}
if (!resultData) {
return (
<Container service={service}>