code style & formatting

This commit is contained in:
shamoon 2023-11-26 14:23:42 -08:00
parent 4c539cf881
commit ccf360b859
2 changed files with 19 additions and 19 deletions

View File

@ -26,12 +26,12 @@ export default function Component({ service }) {
} }
// Default fields // Default fields
if (widget.fields == null || widget.fields.length === 0) { if (!widget.fields?.length > 0) {
widget.fields = ["connectionStatus", "uptime", "maxDown", "maxUp"]; widget.fields = ["connectionStatus", "uptime", "maxDown", "maxUp"];
} }
const MAX_ALLOWED_FIELDS = 4; const MAX_ALLOWED_FIELDS = 4;
// Limits max number of displayed fields // Limits max number of displayed fields
if (widget.fields != null && widget.fields.length > MAX_ALLOWED_FIELDS) { if (widget.fields?.length > MAX_ALLOWED_FIELDS) {
widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS); widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS);
} }