From f296a61fb6acc80b638e64866939bd960cc2232c Mon Sep 17 00:00:00 2001 From: Cora Grant Date: Thu, 31 Oct 2024 17:29:11 -0400 Subject: [PATCH] feat: suppress periodic audio in inspector Avoids being jumpscared by a periodic audio readout that also can't be silenced, short of closing the tab or navigating away. To replace the missing feedback on whether periodic audio is configured, also adds a line to the inspector audio controls to report the readout parameters that would have been used. --- assets/src/components/admin/inspector.tsx | 20 ++++++++++++++++++++ assets/src/hooks/v2/use_audio_readout.tsx | 8 ++++++++ assets/src/util/inspector.ts | 3 +++ 3 files changed, 31 insertions(+) diff --git a/assets/src/components/admin/inspector.tsx b/assets/src/components/admin/inspector.tsx index d21aacb7a..93434bdd9 100644 --- a/assets/src/components/admin/inspector.tsx +++ b/assets/src/components/admin/inspector.tsx @@ -10,6 +10,8 @@ import { useHistory, useLocation } from "react-router-dom"; import AdminForm from "./admin_form"; +import { type AudioConfig } from "Components/v2/screen_container"; + import { doSubmit, type Config, type Screen } from "Util/admin"; import { type Message, @@ -383,6 +385,7 @@ const DataControls: ComponentType<{ }; const AudioControls: ComponentType<{ screen: ScreenWithId }> = ({ screen }) => { + const [config, setConfig] = useState(); // To bypass browser caching, we add a meaningless query param to the URL of // the