diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js b/app/assets/javascripts/discourse/widgets/topic-timeline.js index 617a13bcd4..5f3cabfb8e 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js @@ -388,7 +388,8 @@ createWidget("timeline-footer-controls", { topic, showFullTitle: false, appendReason: false, - placement: "bottom-end" + placement: "bottom-end", + mountedAsWidget: true }, ["notificationLevel"] ) diff --git a/app/assets/javascripts/select-kit/components/topic-notifications-button.js b/app/assets/javascripts/select-kit/components/topic-notifications-button.js index 747685c2ae..a0c16738b5 100644 --- a/app/assets/javascripts/select-kit/components/topic-notifications-button.js +++ b/app/assets/javascripts/select-kit/components/topic-notifications-button.js @@ -10,21 +10,25 @@ export default Component.extend({ didInsertElement() { this._super(...arguments); - this.appEvents.on( - "topic-notifications-button:changed", - this, - "_changeTopicNotificationLevel" - ); + if (!this.mountedAsWidget) { + this.appEvents.on( + "topic-notifications-button:changed", + this, + "_changeTopicNotificationLevel" + ); + } }, willDestroyElement() { this._super(...arguments); - this.appEvents.off( - "topic-notifications-button:changed", - this, - "_changeTopicNotificationLevel" - ); + if (!this.mountedAsWidget) { + this.appEvents.off( + "topic-notifications-button:changed", + this, + "_changeTopicNotificationLevel" + ); + } }, _changeTopicNotificationLevel(level) {