From 98e9e798813aa5cbf7dff05c14df981f58fd5669 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 11 Mar 2026 11:07:23 -0500 Subject: [PATCH] formatting --- web/src/lib/config-schema/transformer.ts | 9 ++------- web/src/pages/Settings.tsx | 14 ++++++++------ web/src/utils/configUtil.ts | 10 ++-------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/web/src/lib/config-schema/transformer.ts b/web/src/lib/config-schema/transformer.ts index 34dd7e45d..b7c0e8c35 100644 --- a/web/src/lib/config-schema/transformer.ts +++ b/web/src/lib/config-schema/transformer.ts @@ -566,9 +566,7 @@ function removePropertyBySegments( if (segments.length === 0 || !isSchemaObject(schema)) return; const [head, ...rest] = segments; - const props = schema.properties as - | Record - | undefined; + const props = schema.properties as Record | undefined; if (rest.length === 0) { // Terminal segment — delete the property @@ -594,10 +592,7 @@ function removePropertyBySegments( if (head === "*") { // Wildcard segment — descend into additionalProperties if (isSchemaObject(schema.additionalProperties)) { - removePropertyBySegments( - schema.additionalProperties as RJSFSchema, - rest, - ); + removePropertyBySegments(schema.additionalProperties as RJSFSchema, rest); } } else if (props && head in props && isSchemaObject(props[head])) { removePropertyBySegments(props[head], rest); diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index e70a0b691..d1cf9a21c 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -515,9 +515,13 @@ const CAMERA_SECTION_MAPPING: Record = { }; // Reverse mapping: page key → config section key -const REVERSE_CAMERA_SECTION_MAPPING: Record = Object.fromEntries( - Object.entries(CAMERA_SECTION_MAPPING).map(([section, page]) => [page, section]), -); +const REVERSE_CAMERA_SECTION_MAPPING: Record = + Object.fromEntries( + Object.entries(CAMERA_SECTION_MAPPING).map(([section, page]) => [ + page, + section, + ]), + ); // masksAndZones is a composite page, not in CAMERA_SECTION_MAPPING REVERSE_CAMERA_SECTION_MAPPING["masksAndZones"] = "masksAndZones"; @@ -1153,9 +1157,7 @@ export default function Settings() { return !!(hasZones || hasMotionMasks || hasObjectMasks); } - return !!profileData[ - currentSectionKey as keyof typeof profileData - ]; + return !!profileData[currentSectionKey as keyof typeof profileData]; }, [config, selectedCamera, currentSectionKey], ); diff --git a/web/src/utils/configUtil.ts b/web/src/utils/configUtil.ts index 0932733e1..980095696 100644 --- a/web/src/utils/configUtil.ts +++ b/web/src/utils/configUtil.ts @@ -208,10 +208,7 @@ export function buildOverrides( // lodash `unset` treats `*` as a literal key. This helper expands wildcard // segments so that e.g. `"filters.*.mask"` unsets `filters..mask`. -function unsetWithWildcard( - obj: Record, - path: string, -): void { +function unsetWithWildcard(obj: Record, path: string): void { if (!path.includes("*")) { unset(obj, path); return; @@ -224,10 +221,7 @@ function unsetWithWildcard( if (parent && typeof parent === "object") { for (const key of Object.keys(parent as Record)) { const fullPath = suffix ? `${key}.${suffix}` : key; - unsetWithWildcard( - parent as Record, - fullPath, - ); + unsetWithWildcard(parent as Record, fullPath); } } }