Skip to content

Commit

Permalink
Merge pull request #13892 from nextcloud/fix/default-devices-state-be…
Browse files Browse the repository at this point in the history
…havior

fix: respect user changes of devices state when toggling it
  • Loading branch information
nickvergessen authored Nov 28, 2024
2 parents 5c823c1 + 1b26aad commit 3044c0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ export default {
},
},

setup() {
setup(props) {
// For debug and screenshot purposes. Set to true to enable
const devMode = ref(false)
provide('CallView:devModeEnabled', devMode)
const screenshotMode = ref(false)
provide('CallView:screenshotModeEnabled', screenshotMode)
const settingsStore = useSettingsStore()
const startWithoutMediaEnabled = settingsStore.startWithoutMedia
if (startWithoutMediaEnabled) {
// If media settings was not used, we check the global config of default devices state here
if (!settingsStore.getShowMediaSettings(props.token) && settingsStore.startWithoutMedia) {
localMediaModel.disableAudio()
localMediaModel.disableVideo()
}
Expand Down
13 changes: 11 additions & 2 deletions src/components/MediaSettings/MediaSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,17 @@ export default {
watch: {
modal(newValue) {
if (newValue) {
this.audioOn = !BrowserStorage.getItem('audioDisabled_' + this.token)
this.videoOn = !BrowserStorage.getItem('videoDisabled_' + this.token)
if (this.settingsStore.startWithoutMedia) {
// Disable audio
this.audioOn = false
BrowserStorage.setItem('audioDisabled_' + this.token, 'true')
// Disable video
this.videoOn = false
BrowserStorage.setItem('videoDisabled_' + this.token, 'true')
} else {
this.audioOn = !BrowserStorage.getItem('audioDisabled_' + this.token)
this.videoOn = !BrowserStorage.getItem('videoDisabled_' + this.token)
}
this.silentCall = !!BrowserStorage.getItem('silentCall_' + this.token)

// Set virtual background depending on BrowserStorage's settings
Expand Down

0 comments on commit 3044c0b

Please sign in to comment.