diff --git a/src/widgets/romm/component.jsx b/src/widgets/romm/component.jsx index 196d69873..ea9549f73 100644 --- a/src/widgets/romm/component.jsx +++ b/src/widgets/romm/component.jsx @@ -4,7 +4,8 @@ import Container from "components/services/widget/container"; import Block from "components/services/widget/block"; import useWidgetAPI from "utils/proxy/use-widget-api"; -export const rommDefaultFields = ["platforms", "totalRoms", "saves", "states"]; +const ROMM_DEFAULT_FIELDS = ["platforms", "totalRoms", "saves", "states"]; +const MAX_ALLOWED_FIELDS = 4; export default function Component({ service }) { const { widget } = service; @@ -15,12 +16,9 @@ export default function Component({ service }) { return ; } - // Default fields if (!widget.fields?.length > 0) { - widget.fields = rommDefaultFields; - } - const MAX_ALLOWED_FIELDS = 4; - if (widget.fields?.length > MAX_ALLOWED_FIELDS) { + widget.fields = ROMM_DEFAULT_FIELDS; + } else if (widget.fields.length > MAX_ALLOWED_FIELDS) { widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS); }