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.
This commit is contained in:
Joffrey JAFFEUX 2020-05-04 18:23:45 +02:00 committed by GitHub
parent c6b31464db
commit 70b1e98609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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