diff --git a/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 b/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 index d6ed2f360a2..c185d2c29a5 100644 --- a/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-notifications.js.es6 @@ -14,6 +14,11 @@ export default Ember.ArrayController.extend({ return length > 0; }, + @computed('model.content.@each.read') + allNotificationsRead() { + return !this.get('model.content').some((notification) => !notification.get('read')); + }, + currentPath: Em.computed.alias('controllers.application.currentPath'), actions: { diff --git a/app/assets/javascripts/discourse/templates/user/notifications.hbs b/app/assets/javascripts/discourse/templates/user/notifications.hbs index 7d0ab5cddcd..8aa71e0867a 100644 --- a/app/assets/javascripts/discourse/templates/user/notifications.hbs +++ b/app/assets/javascripts/discourse/templates/user/notifications.hbs @@ -23,7 +23,8 @@ class='btn dismiss-notifications' action="resetNew" label='user.dismiss_notifications' - icon='check'}} + icon='check' + disabled=allNotificationsRead}} {{/if}}