From 35e821ba21ca25e07257b730f9233ce8c9e2ad15 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Thu, 28 Nov 2024 14:16:23 +0100 Subject: [PATCH] fix: respect user changes of devices state when toggling in media settings Signed-off-by: DorraJaouad --- src/components/CallView/CallView.vue | 6 +++--- src/components/MediaSettings/MediaSettings.vue | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index a09bc6a431c..f47f4f59406 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -197,7 +197,7 @@ export default { }, }, - setup() { + setup(props) { // For debug and screenshot purposes. Set to true to enable const devMode = ref(false) provide('CallView:devModeEnabled', devMode) @@ -205,8 +205,8 @@ export default { 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() } diff --git a/src/components/MediaSettings/MediaSettings.vue b/src/components/MediaSettings/MediaSettings.vue index f0f981279e0..989e05b5138 100644 --- a/src/components/MediaSettings/MediaSettings.vue +++ b/src/components/MediaSettings/MediaSettings.vue @@ -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