Skip to content

Commit

Permalink
fix: reduce the global blur implementation against per conversation l…
Browse files Browse the repository at this point in the history
…evel virtual background

Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Nov 13, 2024
1 parent b97a870 commit 7ebe40a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
26 changes: 13 additions & 13 deletions src/components/MediaSettings/MediaSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,20 +436,19 @@ export default {
this.audioOn = !BrowserStorage.getItem('audioDisabled_' + this.token)
this.videoOn = !BrowserStorage.getItem('videoDisabled_' + this.token)
this.silentCall = !!BrowserStorage.getItem('silentCall_' + this.token)
// Check main blur background setting
if (this.blurBackgroundEnabled) {

// Set virtual background depending on BrowserStorage's settings
if (BrowserStorage.getItem('virtualBackgroundEnabled_' + this.token) === 'true') {
if (BrowserStorage.getItem('virtualBackgroundType_' + this.token) === VIRTUAL_BACKGROUND.BACKGROUND_TYPE.BLUR) {
this.blurVirtualBackground()
} else if (BrowserStorage.getItem('virtualBackgroundType_' + this.token) === VIRTUAL_BACKGROUND.BACKGROUND_TYPE.IMAGE) {
this.setVirtualBackgroundImage(BrowserStorage.getItem('virtualBackgroundUrl_' + this.token))
}
} else if (this.blurBackgroundEnabled) {
// Fall back to global blur background setting
this.blurVirtualBackground()
} else {
// Set virtual background depending on BrowserStorage's settings
if (BrowserStorage.getItem('virtualBackgroundEnabled_' + this.token) === 'true') {
if (BrowserStorage.getItem('virtualBackgroundType_' + this.token) === VIRTUAL_BACKGROUND.BACKGROUND_TYPE.BLUR) {
this.blurVirtualBackground()
} else if (BrowserStorage.getItem('virtualBackgroundType_' + this.token) === VIRTUAL_BACKGROUND.BACKGROUND_TYPE.IMAGE) {
this.setVirtualBackgroundImage(BrowserStorage.getItem('virtualBackgroundUrl_' + this.token))
}
} else {
this.clearVirtualBackground()
}
this.clearVirtualBackground()
}

this.initializeDevices()
Expand All @@ -476,8 +475,9 @@ export default {

isInCall(value) {
if (value) {
const virtualBackgroundEnabled = BrowserStorage.getItem('virtualBackgroundEnabled_' + this.token) === 'true'
// Apply global blur background setting
if (this.blurBackgroundEnabled && !this.skipBlurBackgroundEnabled) {
if (this.blurBackgroundEnabled && !this.skipBlurBackgroundEnabled && !virtualBackgroundEnabled) {
this.blurBackground(true)
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/components/MediaSettings/VideoBackgroundEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ export default {
},

loadBackground() {
// Set virtual background depending on main blur setting (in Talk settings)
if (this.settingsStore.blurBackgroundEnabled) {
this.selectedBackground = 'blur'
return
}
// Set virtual background depending on browser storage's settings
if (BrowserStorage.getItem('virtualBackgroundEnabled_' + this.token) === 'true') {
if (BrowserStorage.getItem('virtualBackgroundType_' + this.token) === VIRTUAL_BACKGROUND.BACKGROUND_TYPE.BLUR) {
Expand All @@ -270,6 +265,8 @@ export default {
} else {
this.selectedBackground = 'none'
}
} else if (this.settingsStore.blurBackgroundEnabled) {
this.selectedBackground = 'blur'
} else {
this.selectedBackground = 'none'
}
Expand Down

0 comments on commit 7ebe40a

Please sign in to comment.