From 92b3e27c4089df5c5389b06217f75e29ee1c396e Mon Sep 17 00:00:00 2001 From: Maximilian Harz Date: Fri, 4 Apr 2025 16:10:01 +0200 Subject: [PATCH] Fix initialisation of notification settings --- webapp/pages/settings/notifications.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/webapp/pages/settings/notifications.vue b/webapp/pages/settings/notifications.vue index 5193938a7..6e7ce3a53 100644 --- a/webapp/pages/settings/notifications.vue +++ b/webapp/pages/settings/notifications.vue @@ -24,7 +24,15 @@ import { updateUserMutation } from '~/graphql/User' export default { data() { return { - emailNotificationSettings: [...this.currentUser.emailNotificationSettings], + emailNotificationSettings: { + commentOnObservedPost: true, + postByFollowedUser: true, + postInGroup: true, + groupMemberJoined: true, + groupMemberLeft: true, + groupMemberRemoved: true, + groupMemberRoleChanged: true, + }, topics: [ { id: 'commentOnObservedPost', @@ -32,13 +40,13 @@ export default { }, { id: 'postByFollowedUser', name: this.$t('settings.notifications.postByFollowedUser') }, { id: 'postInGroup', name: this.$t('settings.notifications.postInGroup') }, - { id: 'groupMemberJoined', name: this.$t('settings.notifications.groupMemberJoined') }, - { id: 'groupMemberLeft', name: this.$t('settings.notifications.groupMemberLeft') }, { id: 'groupMemberRemoved', name: this.$t('settings.notifications.groupMemberRemoved') }, { id: 'groupMemberRoleChanged', name: this.$t('settings.notifications.groupMemberRoleChanged'), }, + { id: 'groupMemberJoined', name: this.$t('settings.notifications.groupMemberJoined') }, + { id: 'groupMemberLeft', name: this.$t('settings.notifications.groupMemberLeft') }, ], } }, @@ -52,6 +60,9 @@ export default { ) }, }, + created() { + this.emailNotificationSettings = { ...this.currentUser.emailNotificationSettings } + }, methods: { ...mapMutations({ setCurrentUser: 'auth/SET_USER',