From 56e2aeee7783684538b5e409ae2d8bf2bc1bd255 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 4 May 2020 18:23:45 +0200 Subject: [PATCH] FIX: reverts to use an observer to support loading more notifications (#9628) Apparently, didReceiveAttrs is not called when loading more notifications, this would require a more heavy refactoring. --- .../discourse/app/components/user-notifications-large.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/user-notifications-large.js b/app/assets/javascripts/discourse/app/components/user-notifications-large.js index 193a5b8b12..5f50878099 100644 --- a/app/assets/javascripts/discourse/app/components/user-notifications-large.js +++ b/app/assets/javascripts/discourse/app/components/user-notifications-large.js @@ -1,4 +1,5 @@ import MountWidget from "discourse/components/mount-widget"; +import { observes } from "discourse-common/utils/decorators"; export default MountWidget.extend({ widget: "user-notifications-large", @@ -6,9 +7,14 @@ export default MountWidget.extend({ filter: null, args: null, - didReceiveAttrs() { + init() { this._super(...arguments); + this.args = { notifications: this.notifications, filter: this.filter }; + }, + + @observes("notifications.length", "notifications.@each.read", "filter") + _triggerRefresh() { this.set("args", { notifications: this.notifications, filter: this.filter