From 5285cbee62ad7b0cee5b3bf0b6449174fb4f4491 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 4 May 2020 13:16:53 +0200 Subject: [PATCH] FIX: shows filter if there's no notifications to show after filter --- .../discourse/app/controllers/user-notifications.js | 2 +- .../discourse/app/templates/user/notifications-index.hbs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/user-notifications.js b/app/assets/javascripts/discourse/app/controllers/user-notifications.js index e821b68364f..c0761e70dcb 100644 --- a/app/assets/javascripts/discourse/app/controllers/user-notifications.js +++ b/app/assets/javascripts/discourse/app/controllers/user-notifications.js @@ -16,7 +16,7 @@ export default Controller.extend({ }, @discourseComputed("model.content.length", "filter") - hasNotifications(length, filter) { + hasFilteredNotifications(length, filter) { if (filter === "read") { return this.model.filterBy("read", true).length > 0; } else if (filter === "unread") { diff --git a/app/assets/javascripts/discourse/app/templates/user/notifications-index.hbs b/app/assets/javascripts/discourse/app/templates/user/notifications-index.hbs index adf5d0d11d8..b2c9185ec47 100644 --- a/app/assets/javascripts/discourse/app/templates/user/notifications-index.hbs +++ b/app/assets/javascripts/discourse/app/templates/user/notifications-index.hbs @@ -8,9 +8,10 @@ {{/if}} -{{#if hasNotifications}} - {{notifications-filter value=filter onChange=(action "filterNotifications")}} - +{{notifications-filter value=filter onChange=(action "filterNotifications")}} + + +{{#if hasFilteredNotifications}} {{user-notifications-large notifications=model filter=filter}} {{conditional-loading-spinner condition=loading}} {{else}}