summaryrefslogtreecommitdiffstats
path: root/client/components/notifications/notificationsDrawer.js
diff options
context:
space:
mode:
authorNicoP-S <paetni1@gmail.com>2020-04-08 23:22:49 +0200
committerGitHub <noreply@github.com>2020-04-08 23:22:49 +0200
commit7c2554297617898187906baa646b5b89f6f37af6 (patch)
treeacd374922850b5ed7468c37908e0c14318f3bca0 /client/components/notifications/notificationsDrawer.js
parent411b8d3f56ed2c77f0e46be92fd7d78c32fa0c9e (diff)
parent121686a928029609e46740d78e129d91fae432e5 (diff)
downloadwekan-7c2554297617898187906baa646b5b89f6f37af6.tar.gz
wekan-7c2554297617898187906baa646b5b89f6f37af6.tar.bz2
wekan-7c2554297617898187906baa646b5b89f6f37af6.zip
Merge pull request #5 from wekan/master
Update
Diffstat (limited to 'client/components/notifications/notificationsDrawer.js')
-rw-r--r--client/components/notifications/notificationsDrawer.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/components/notifications/notificationsDrawer.js b/client/components/notifications/notificationsDrawer.js
index 98d4750d..76abeea7 100644
--- a/client/components/notifications/notificationsDrawer.js
+++ b/client/components/notifications/notificationsDrawer.js
@@ -16,6 +16,13 @@ Template.notificationsDrawer.helpers({
transformedProfile() {
return Users.findOne(Meteor.userId());
},
+ readNotifications() {
+ const readNotifications = _.filter(
+ Meteor.user().profile.notifications,
+ v => !!v.read,
+ );
+ return readNotifications.length;
+ },
});
Template.notificationsDrawer.events({
@@ -35,4 +42,12 @@ Template.notificationsDrawer.events({
'click .toggle-read'() {
Session.set('showReadNotifications', !Session.get('showReadNotifications'));
},
+ 'click .remove-read'() {
+ const user = Meteor.user();
+ for (const notification of user.profile.notifications) {
+ if (notification.read) {
+ user.removeNotification(notification.activity);
+ }
+ }
+ },
});