Skip to content

Commit

Permalink
fix: respect user changes of devices state when toggling in media set…
Browse files Browse the repository at this point in the history
…tings

Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad authored and backportbot[bot] committed Nov 28, 2024
1 parent 1aadce9 commit 35e821b
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,16 +197,16 @@ 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 35e821b

Please sign in to comment.