Fix: enforce max field blocks for esp home widget (#5951)
This commit is contained in:
parent
3ef7031eb0
commit
afc0fe29ee
1 changed files with 6 additions and 0 deletions
|
|
@ -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}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue