summaryrefslogtreecommitdiffstats
path: root/src/components/SettingsDialog
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2020-12-10 14:12:26 +0100
committerVincent Petry <vincent@nextcloud.com>2020-12-10 14:12:26 +0100
commitbd9aead8c1e1eb94e665c3ec44279757a21ebcfa (patch)
tree54530fb56c4b39530571b04a1a66b604f00d72eb /src/components/SettingsDialog
parent1e3107771b82640651c478ed990d29aa73089046 (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.vue9
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() {