Sort camera group edit screen by ui config values (#15705)

This commit is contained in:
Josh Hawkins 2024-12-27 14:30:27 -06:00 committed by GitHub
parent c48396c5c6
commit 8114b541a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -755,7 +755,11 @@ export function CameraGroupEdit({
<FormMessage /> <FormMessage />
{[ {[
...(birdseyeConfig?.enabled ? ["birdseye"] : []), ...(birdseyeConfig?.enabled ? ["birdseye"] : []),
...Object.keys(config?.cameras ?? {}), ...Object.keys(config?.cameras ?? {}).sort(
(a, b) =>
(config?.cameras[a]?.ui?.order ?? 0) -
(config?.cameras[b]?.ui?.order ?? 0),
),
].map((camera) => ( ].map((camera) => (
<FormControl key={camera}> <FormControl key={camera}>
<FilterSwitch <FilterSwitch