diff --git a/src/components/AdminSettings/GeneralSettings.vue b/src/components/AdminSettings/GeneralSettings.vue index 28269aec8..f142f6cc9 100644 --- a/src/components/AdminSettings/GeneralSettings.vue +++ b/src/components/AdminSettings/GeneralSettings.vue @@ -41,17 +41,15 @@

{{ t('spreed', 'Integration into other apps') }}

- + @update:checked="saveConversationsFiles"> {{ t('spreed', 'Allow conversations on files') }} - + {{ t('spreed', 'Allow conversations on public shares for files') }} @@ -84,16 +82,23 @@ export default { defaultGroupNotificationOptions, defaultGroupNotification: defaultGroupNotificationOptions[1], - conversationsFiles: true, - conversationsFilesPublicShares: true, + conversationsFiles: parseInt(loadState('spreed', 'conversations_files')) === 1, + conversationsFilesPublicShares: parseInt(loadState('spreed', 'conversations_files_public_shares')) === 1, } }, + computed: { + isConversationsFilesChecked() { + return this.conversationsFiles + }, + isConversationsFilesPublicSharesChecked() { + return this.conversationsFilesPublicShares + }, + }, + mounted() { this.loading = true - this.conversationsFiles = parseInt(loadState('spreed', 'conversations_files')) === 1 this.defaultGroupNotification = defaultGroupNotificationOptions[parseInt(loadState('spreed', 'default_group_notification')) - 1] - this.conversationsFilesPublicShares = parseInt(loadState('spreed', 'conversations_files_public_shares')) === 1 this.loading = false }, @@ -107,8 +112,9 @@ export default { }.bind(this), }) }, - saveConversationsFiles() { + saveConversationsFiles(checked) { this.loadingConversationsFiles = true + this.conversationsFiles = checked OCP.AppConfig.setValue('spreed', 'conversations_files', this.conversationsFiles ? '1' : '0', { success: function() { @@ -126,8 +132,9 @@ export default { }.bind(this), }) }, - saveConversationsFilesPublicShares() { + saveConversationsFilesPublicShares(checked) { this.loadingConversationsFiles = true + this.conversationsFilesPublicShares = checked OCP.AppConfig.setValue('spreed', 'conversations_files_public_shares', this.conversationsFilesPublicShares ? '1' : '0', { success: function() {