FIX: ensures shortcuts work correctly with topic-notifications-button (#8956)
This commit is contained in:
parent
42bda52486
commit
3875785dcc
|
@ -6,11 +6,35 @@ export default Component.extend({
|
|||
appendReason: true,
|
||||
showFullTitle: true,
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.appEvents.on(
|
||||
"topic-notifications-button:changed",
|
||||
this,
|
||||
"_changeTopicNotificationLevel"
|
||||
);
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.appEvents.off(
|
||||
"topic-notifications-button:changed",
|
||||
this,
|
||||
"_changeTopicNotificationLevel"
|
||||
);
|
||||
},
|
||||
|
||||
_changeTopicNotificationLevel(level) {
|
||||
if (level.id !== this.notificationLevel) {
|
||||
this.topic.details.updateNotifications(level.id);
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
changeTopicNotificationLevel(newNotificationLevel) {
|
||||
if (newNotificationLevel !== this.notificationLevel) {
|
||||
this.topic.details.updateNotifications(newNotificationLevel);
|
||||
}
|
||||
changeTopicNotificationLevel(level, notification) {
|
||||
this._changeTopicNotificationLevel(notification);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -16,17 +16,5 @@ export default NotificationsButtonComponent.extend({
|
|||
|
||||
i18nPostfix: computed("topic.archetype", function() {
|
||||
return this.topic.archetype === "private_message" ? "_pm" : "";
|
||||
}),
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.appEvents.on("topic-notifications-button:changed", this, "onSelect");
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.appEvents.off("topic-notifications-button:changed", this, "onSelect");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue