pleroma-fe/src/components/settings_modal/tabs/notifications_tab.js

37 lines
884 B
JavaScript
Raw Normal View History

import BooleanSetting from '../helpers/boolean_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
2020-05-03 17:36:12 +03:00
const NotificationsTab = {
2026-01-06 16:22:52 +02:00
data() {
2020-05-03 17:36:12 +03:00
return {
activeTab: 'profile',
2026-01-06 16:22:52 +02:00
notificationSettings:
this.$store.state.users.currentUser.notification_settings,
newDomainToMute: '',
2020-05-03 17:36:12 +03:00
}
},
components: {
2026-01-06 16:22:52 +02:00
BooleanSetting,
2020-05-03 17:36:12 +03:00
},
computed: {
2026-01-06 16:22:52 +02:00
user() {
2020-05-03 17:36:12 +03:00
return this.$store.state.users.currentUser
},
2026-01-06 16:22:52 +02:00
canReceiveReports() {
if (!this.user) {
return false
}
return this.user.privileges.includes('reports_manage_reports')
},
2026-01-06 16:22:52 +02:00
...SharedComputedObject(),
2020-05-03 17:36:12 +03:00
},
methods: {
2026-01-06 16:22:52 +02:00
updateNotificationSettings() {
this.$store.state.api.backendInteractor.updateNotificationSettings({
settings: this.notificationSettings,
})
},
},
2020-05-03 17:36:12 +03:00
}
export default NotificationsTab