From 707b84469b048e0977f8519f6f8bbe402bd2756b Mon Sep 17 00:00:00 2001 From: Greg Fodor <gfodor@gmail.com> Date: Thu, 8 Mar 2018 17:28:29 -0800 Subject: [PATCH] Fix up tone to be less annoying --- src/react-components/ui-root.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js index a75f3c8f8..ac4dfebe2 100644 --- a/src/react-components/ui-root.js +++ b/src/react-components/ui-root.js @@ -142,9 +142,17 @@ class UIRoot extends Component { setTimeout(() => this.setState({ tonePlaying: false }), 2000); }; - playTone(); - const toneInterval = setInterval(playTone, 5000); - this.setState({ toneInterval, entryStep: ENTRY_STEPS.audio_setup }); + // Delay initial tone slightly so we don't always hear it. + setTimeout(() => { + if (this.state.entryStep === ENTRY_STEPS.audio_setup) { + playTone(); + + const toneInterval = setInterval(playTone, 5000); + this.setState({ toneInterval }); + } + }, 2500); + + this.setState({ entryStep: ENTRY_STEPS.audio_setup }); } fetchMicDevices = async () => { -- GitLab