Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-08-31 16:22:07 +0300
committerGitHub <noreply@github.com>2021-08-31 16:22:07 +0300
commitf52dd9e943152c8291a9e5bcd3ef29cbf9ae86a5 (patch)
tree7d3ce44b04fadaee424b3ea920172c5a8b36a126
parent01b5d732924a3a4a3e9f22a3a4f0055521277149 (diff)
parente122fdb2f1ffe4a96211db4de200e791cd494b57 (diff)
Merge pull request #6179 from nextcloud/backport/6160/stable22.1
[stable22.1] Don't save device selection when there is only one device
-rw-r--r--src/components/MediaDevicesSelector.vue21
-rw-r--r--src/utils/webrtc/MediaDevicesManager.js2
2 files changed, 22 insertions, 1 deletions
diff --git a/src/components/MediaDevicesSelector.vue b/src/components/MediaDevicesSelector.vue
index 096d85670..d9ffa8a0b 100644
--- a/src/components/MediaDevicesSelector.vue
+++ b/src/components/MediaDevicesSelector.vue
@@ -155,7 +155,26 @@ export default {
// The watcher should not be set as "immediate" to prevent
// "update:deviceId" from being emitted when mounted with the same value
// initially passed to the component.
- deviceSelectedOption(deviceSelectedOption) {
+ deviceSelectedOption(deviceSelectedOption, previousSelectedOption) {
+ // The deviceSelectedOption may be the same as before yet a change
+ // could be triggered if media permissions are granted, which would
+ // update the label.
+ if (deviceSelectedOption && previousSelectedOption && deviceSelectedOption.id === previousSelectedOption.id) {
+ return
+ }
+
+ // The previous selected option changed due to the device being
+ // disconnected, so ignore it as it was not explicitly changed by
+ // the user.
+ if (previousSelectedOption && previousSelectedOption.id && !this.deviceOptions.find(option => option.id === previousSelectedOption.id)) {
+ return
+ }
+
+ // Ignore device change on initial loading of the settings dialog.
+ if (typeof previousSelectedOption?.id === 'undefined') {
+ return
+ }
+
if (deviceSelectedOption && deviceSelectedOption.id === null) {
this.$emit('update:deviceId', null)
return
diff --git a/src/utils/webrtc/MediaDevicesManager.js b/src/utils/webrtc/MediaDevicesManager.js
index d14ad521b..72efd364c 100644
--- a/src/utils/webrtc/MediaDevicesManager.js
+++ b/src/utils/webrtc/MediaDevicesManager.js
@@ -115,6 +115,8 @@ MediaDevicesManager.prototype = {
this._trigger('change:' + key, [value])
this._storeDeviceId(key, value)
+
+ console.debug('Storing device selection in the browser storage: ', key, value)
},
_storeDeviceId(key, value) {