Ensure review cameras are sorted by config ui order if specified (#12789)

This commit is contained in:
Josh Hawkins 2024-08-06 10:41:11 -05:00 committed by Nicolas Mowen
parent 8212b66ee0
commit 54e1bd9eeb

View File

@ -136,7 +136,11 @@ export default function ReviewFilterGroup({
const filterValues = useMemo(
() => ({
cameras: Object.keys(config?.cameras || {}),
cameras: Object.keys(config?.cameras ?? {}).sort(
(a, b) =>
(config?.cameras[a]?.ui?.order ?? 0) -
(config?.cameras[b]?.ui?.order ?? 0),
),
labels: Object.values(allLabels || {}),
zones: Object.values(allZones || {}),
}),