aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications/notifications.js
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-08-31 04:10:17 +0000
committerkaniini <nenolod@gmail.com>2018-08-31 04:10:17 +0000
commit958acbab8d43b7514369f4bc69bc2fe0353eddf2 (patch)
tree9c7b9d868f4b1cf8f0e592cdd607999d5484a18c /src/components/notifications/notifications.js
parent48391a45ba8924e20f280868bca78d77a32c3ddd (diff)
parent8c07e63f773a15119f3cf773c083fe3b76306c3f (diff)
Merge branch 'polish' into 'develop'
Another one of those MR that fixes many many small-to-medium things Closes #92, #75, #122, #52, #72, and #87 See merge request pleroma/pleroma-fe!324
Diffstat (limited to 'src/components/notifications/notifications.js')
-rw-r--r--src/components/notifications/notifications.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index b24250b0..58956f98 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -11,6 +11,14 @@ const Notifications = {
notificationsFetcher.startFetching({ store, credentials })
},
computed: {
+ visibleTypes () {
+ return [
+ this.$store.state.config.notificationVisibility.likes && 'like',
+ this.$store.state.config.notificationVisibility.mentions && 'mention',
+ this.$store.state.config.notificationVisibility.repeats && 'repeat',
+ this.$store.state.config.notificationVisibility.follows && 'follow'
+ ].filter(_ => _)
+ },
notifications () {
return this.$store.state.statuses.notifications.data
},
@@ -18,13 +26,13 @@ const Notifications = {
return this.$store.state.statuses.notifications.error
},
unseenNotifications () {
- return filter(this.notifications, ({seen}) => !seen)
+ return filter(this.visibleNotifications, ({seen}) => !seen)
},
visibleNotifications () {
// Don't know why, but sortBy([seen, -action.id]) doesn't work.
let sortedNotifications = sortBy(this.notifications, ({action}) => -action.id)
sortedNotifications = sortBy(sortedNotifications, 'seen')
- return sortedNotifications
+ return sortedNotifications.filter((notification) => this.visibleTypes.includes(notification.type))
},
unseenCount () {
return this.unseenNotifications.length