@ -58,11 +58,11 @@
: title = "t('spreed', 'Sounds')"
class = "app-settings-section" >
< input id = "play_sounds"
v - model = "playSounds"
: checked = "readStatusPrivacyIsPublic"
: disabled = "privacyLoading"
: checked = "playSounds"
: disabled = "playSoundsLoading"
type = "checkbox"
class = "checkbox" >
class = "checkbox"
@ change = "togglePlaySounds" >
< label for = "play_sounds" > { { t ( 'settings' , 'Play sounds when participants join a call or leave it' ) } } < / label >
< em > { { t ( 'settings' , 'Sounds can currently not be played in Safari browser and iPad and iPhone devices due to technical restrictions by the manufacturer.' ) } } < / em >
< / AppSettingsSection >
@ -129,10 +129,6 @@
< script >
import { getFilePickerBuilder , showError , showSuccess } from '@nextcloud/dialogs'
import {
setAttachmentFolder ,
setPlaySounds ,
} from '../../services/settingsService'
import { PRIVACY } from '../../constants'
import { subscribe , unsubscribe } from '@nextcloud/event-bus'
import MediaDevicesPreview from '../MediaDevicesPreview'
@ -153,23 +149,13 @@ export default {
showSettings : false ,
attachmentFolderLoading : true ,
privacyLoading : false ,
playSoundsLoading : false ,
}
} ,
computed : {
/ / L o c a l s e t t i n g s
playSounds : {
get ( ) {
return this . $store . getters . playSounds
} ,
set ( status ) {
this . $store . commit ( 'setPlaySounds' , status )
try {
setPlaySounds ( status )
} catch ( e ) {
showError ( t ( 'spreed' , 'Failed to save sounds setting' ) )
}
} ,
playSounds ( ) {
return this . $store . getters . playSounds
} ,
attachmentFolder ( ) {
@ -216,14 +202,11 @@ export default {
throw new Error ( t ( 'spreed' , 'Invalid path selected' ) )
}
const oldFolder = this . attachmentFolder
this . attachmentFolderLoading = true
try {
this . $store . commit ( 'setAttachmentFolder' , path )
await setAttachmentFolder ( path )
this . $store . dispatch ( 'setAttachmentFolder' , path )
} catch ( exception ) {
showError ( t ( 'spreed' , 'Error while setting attachment folder' ) )
this . $store . commit ( 'setAttachmentFolder' , oldFolder )
}
this . attachmentFolderLoading = false
} )
@ -243,6 +226,21 @@ export default {
this . privacyLoading = false
} ,
async togglePlaySounds ( ) {
this . playSoundsLoading = true
try {
try {
await this . $store . dispatch ( 'setPlaySounds' , status )
} catch ( e ) {
showError ( t ( 'spreed' , 'Failed to save sounds setting' ) )
}
showSuccess ( t ( 'spreed' , 'Sounds setting saved' ) )
} catch ( exception ) {
showError ( t ( 'spreed' , 'Error while saving sounds setting' ) )
}
this . playSoundsLoading = false
} ,
handleShowSettings ( ) {
this . showSettings = true
} ,