mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 01:38:51 +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'),
|
label: _t('Default Device'),
|
||||||
};
|
};
|
||||||
|
|
||||||
const audioInputs = this.state.mediaDevices.audioinput;
|
const audioInputs = this.state.mediaDevices.audioinput.slice(0);
|
||||||
if (audioInputs.length > 0) {
|
if (audioInputs.length > 0) {
|
||||||
if (!audioInputs.some((input) => input.deviceId === 'default')) {
|
if (!audioInputs.some((input) => input.deviceId === 'default')) {
|
||||||
audioInputs.unshift(defaultOption);
|
audioInputs.unshift(defaultOption);
|
||||||
|
@ -972,7 +972,7 @@ module.exports = React.createClass({
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const videoInputs = this.state.mediaDevices.videoinput;
|
const videoInputs = this.state.mediaDevices.videoinput.slice(0);
|
||||||
if (videoInputs.length > 0) {
|
if (videoInputs.length > 0) {
|
||||||
if (!videoInputs.some((input) => input.deviceId === 'default')) {
|
if (!videoInputs.some((input) => input.deviceId === 'default')) {
|
||||||
videoInputs.unshift(defaultOption);
|
videoInputs.unshift(defaultOption);
|
||||||
|
|
Loading…
Reference in a new issue