mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-02 16:25:56 +03:00
copy the arrays so we're not making a mess
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0f2c89d525
commit
beedeec163
1 changed files with 2 additions and 2 deletions
|
@ -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({
|
|||
</div>;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue