From 39f889a716cf25830fa8b44a418a083946a0ac57 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sun, 20 Feb 2022 07:58:47 -0700 Subject: [PATCH] Filter cameras when set to not be shown. --- web/src/Sidebar.jsx | 2 +- web/src/routes/Cameras.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/Sidebar.jsx b/web/src/Sidebar.jsx index 7551ceeb6..9c2e55e22 100644 --- a/web/src/Sidebar.jsx +++ b/web/src/Sidebar.jsx @@ -20,7 +20,7 @@ export default function Sidebar() { matches ? ( - {cameras.sort(([aCam, aConf], [bCam, bConf]) => aConf.gui.order === bConf.gui.order ? 0 : (aConf.gui.order > bConf.gui.order ? 1 : -1)).map(([camera]) => ( + {cameras.filter(([cam, conf]) => conf.gui.show).sort(([aCam, aConf], [bCam, bConf]) => aConf.gui.order === bConf.gui.order ? 0 : (aConf.gui.order > bConf.gui.order ? 1 : -1)).map(([camera]) => ( ))} diff --git a/web/src/routes/Cameras.jsx b/web/src/routes/Cameras.jsx index 93e196821..1cf593a8e 100644 --- a/web/src/routes/Cameras.jsx +++ b/web/src/routes/Cameras.jsx @@ -16,7 +16,7 @@ export default function Cameras() { ) : (
- {Object.entries(config.cameras).sort(([aCam, aConf], [bCam, bConf]) => aConf.gui.order === bConf.gui.order ? 0 : (aConf.gui.order > bConf.gui.order ? 1 : -1)).map(([camera, conf]) => ( + {Object.entries(config.cameras).filter(([cam, conf]) => conf.gui.show).sort(([aCam, aConf], [bCam, bConf]) => aConf.gui.order === bConf.gui.order ? 0 : (aConf.gui.order > bConf.gui.order ? 1 : -1)).map(([camera, conf]) => ( ))}