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 7b274b6974
commit f47984818f

View File

@ -136,7 +136,11 @@ export default function ReviewFilterGroup({
const filterValues = useMemo( 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 || {}), labels: Object.values(allLabels || {}),
zones: Object.values(allZones || {}), zones: Object.values(allZones || {}),
}), }),