diff options
author | Vincent Petry <vincent@nextcloud.com> | 2020-12-10 14:12:26 +0100 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-12-10 14:12:26 +0100 |
commit | bd9aead8c1e1eb94e665c3ec44279757a21ebcfa (patch) | |
tree | 54530fb56c4b39530571b04a1a66b604f00d72eb /src/components/SettingsDialog | |
parent | 1e3107771b82640651c478ed990d29aa73089046 (diff) |
Fix saving privacy setting about read status
Now using dispatch to properly trigger the action.
Added disabled state and notification.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src/components/SettingsDialog')
-rw-r--r-- | src/components/SettingsDialog/SettingsDialog.vue | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/SettingsDialog/SettingsDialog.vue b/src/components/SettingsDialog/SettingsDialog.vue index 39da96b91..8041db3f3 100644 --- a/src/components/SettingsDialog/SettingsDialog.vue +++ b/src/components/SettingsDialog/SettingsDialog.vue @@ -43,6 +43,7 @@ class="app-settings-section"> <input id="read_status_privacy" :checked="readStatusPrivacyIsPublic" + :disabled="privacyLoading" type="checkbox" name="read_status_privacy" class="checkbox" @@ -105,7 +106,7 @@ </template> <script> -import { getFilePickerBuilder, showError } from '@nextcloud/dialogs' +import { getFilePickerBuilder, showError, showSuccess } from '@nextcloud/dialogs' import { setAttachmentFolder } from '../../services/settingsService' import { PRIVACY } from '../../constants' import { subscribe, unsubscribe } from '@nextcloud/event-bus' @@ -126,6 +127,7 @@ export default { return { showSettings: false, attachmentFolderLoading: true, + privacyLoading: false, } }, @@ -188,14 +190,17 @@ export default { }, async toggleReadStatusPrivacy() { + this.privacyLoading = true try { - await this.$store.commit( + await this.$store.dispatch( 'updateReadStatusPrivacy', this.readStatusPrivacyIsPublic ? PRIVACY.PRIVATE : PRIVACY.PUBLIC ) + showSuccess(t('spreed', 'Your privacy setting has been saved')) } catch (exception) { showError(t('spreed', 'Error while setting read status privacy')) } + this.privacyLoading = false }, handleShowSettings() { |