From ee84e2fb4d0a9a7690079a11f05f51df265ad747 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Wed, 4 Apr 2018 11:53:24 -0700
Subject: [PATCH] Only do one media query since we can use ideal

---
 src/react-components/ui-root.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js
index 56e57b92d..83ddd1177 100644
--- a/src/react-components/ui-root.js
+++ b/src/react-components/ui-root.js
@@ -290,12 +290,10 @@ class UIRoot extends Component {
     let hasAudio = false;
     const { lastUsedMicDeviceId } = this.props.store.state;
 
-    // Try to fetch last used mic, and if we don't get it then fall back to default.
+    // Try to fetch last used mic, if there was one.
     if (lastUsedMicDeviceId) {
       hasAudio = await this.fetchAudioTrack({ audio: { deviceId: { ideal: lastUsedMicDeviceId } } });
-    }
-
-    if (!hasAudio) {
+    } else {
       hasAudio = await this.fetchAudioTrack({ audio: true });
     }
 
-- 
GitLab