Filter cameras when set to not be shown.

This commit is contained in:
Nick Mowen 2022-02-20 07:58:47 -07:00
parent 3f24cee86d
commit 39f889a716
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export default function Sidebar() {
matches ? (
<Fragment>
<Separator />
{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]) => (
<Destination href={`/cameras/${camera}`} text={camera} />
))}
<Separator />

View File

@ -16,7 +16,7 @@ export default function Cameras() {
<ActivityIndicator />
) : (
<div className="grid grid-cols-1 3xl:grid-cols-3 md:grid-cols-2 gap-4">
{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]) => (
<Camera name={camera} conf={conf} />
))}
</div>