Skip to content

Commit

Permalink
Ensure review cameras are sorted by config ui order if specified (#12789
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hawkeye217 authored Aug 6, 2024
1 parent 069c50a commit 4d0f88c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/components/filter/ReviewFilterGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {}),
}),
Expand Down

0 comments on commit 4d0f88c

Please sign in to comment.