From beedeec1636e0d43938b0edeaf688a98b78117ff Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Jun 2017 23:50:14 +0100 Subject: [PATCH] copy the arrays so we're not making a mess Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/UserSettings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 9a55094edf..b5d5c23296 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -956,7 +956,7 @@ module.exports = React.createClass({ label: _t('Default Device'), }; - const audioInputs = this.state.mediaDevices.audioinput; + const audioInputs = this.state.mediaDevices.audioinput.slice(0); if (audioInputs.length > 0) { if (!audioInputs.some((input) => input.deviceId === 'default')) { audioInputs.unshift(defaultOption); @@ -972,7 +972,7 @@ module.exports = React.createClass({ ; } - const videoInputs = this.state.mediaDevices.videoinput; + const videoInputs = this.state.mediaDevices.videoinput.slice(0); if (videoInputs.length > 0) { if (!videoInputs.some((input) => input.deviceId === 'default')) { videoInputs.unshift(defaultOption);