From 889835a59b0fae0d7ce340ff933550afa0c57645 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 12 Feb 2022 12:51:28 -0700 Subject: [PATCH] Always show recording link even if recordings are currently disabled (#2787) * Always show recording link even if recordings are currently disabled * Fix test to consider all cameras to have recording link --- web/src/routes/Cameras.jsx | 8 ++------ web/src/routes/__tests__/Cameras.test.jsx | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/web/src/routes/Cameras.jsx b/web/src/routes/Cameras.jsx index 94b7cb7f1b..3bb5647bd1 100644 --- a/web/src/routes/Cameras.jsx +++ b/web/src/routes/Cameras.jsx @@ -29,12 +29,8 @@ function Camera({ name, conf }) { const { payload: snapshotValue, send: sendSnapshots } = useSnapshotsState(name); const href = `/cameras/${name}`; const buttons = useMemo(() => { - const result = [{ name: 'Events', href: `/events?camera=${name}` }]; - if (conf.record.enabled) { - result.push({ name: 'Recordings', href: `/recording/${name}` }); - } - return result; - }, [name, conf.record.enabled]); + return [{ name: 'Events', href: `/events?camera=${name}` }, { name: 'Recordings', href: `/recording/${name}` }]; + }, [name]); const icons = useMemo( () => [ { diff --git a/web/src/routes/__tests__/Cameras.test.jsx b/web/src/routes/__tests__/Cameras.test.jsx index 68d0d0a801..cdb0c400d9 100644 --- a/web/src/routes/__tests__/Cameras.test.jsx +++ b/web/src/routes/__tests__/Cameras.test.jsx @@ -46,7 +46,7 @@ describe('Cameras Route', () => { expect(screen.queryByLabelText('Loading…')).not.toBeInTheDocument(); - expect(screen.queryAllByText('Recordings')).toHaveLength(1); + expect(screen.queryAllByText('Recordings')).toHaveLength(2); }); test('buttons toggle detect, clips, and snapshots', async () => {