sort preview cameras in history by ui order

This commit is contained in:
Josh Hawkins 2026-07-06 16:20:30 -05:00
parent 4ee12e6237
commit 105d1e8885

View File

@ -75,11 +75,13 @@ export default function Events() {
return [] as string[]; return [] as string[];
} }
return Object.keys(config.cameras).filter( return Object.values(config.cameras)
(cam) => .filter(
allowedCameras.includes(cam) && (conf) =>
config.cameras[cam]?.ui?.review !== false, allowedCameras.includes(conf.name) && conf.ui?.review !== false,
); )
.sort((aConf, bConf) => aConf.ui.order - bConf.ui.order)
.map((conf) => conf.name);
}, [allowedCameras, config?.cameras]); }, [allowedCameras, config?.cameras]);
const selectedMotionSearchCamera = useMemo(() => { const selectedMotionSearchCamera = useMemo(() => {