From e4d557cdb930699ed18e95adb1ef8885f0cfb9a4 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 17 May 2017 21:42:31 +0800 Subject: [PATCH] Partially revert https://github.com/discourse/discourse/commit/92118dd1d1f3db4abc5405f04707b5f3e0deec88. --- .../discourse/components/topic-notifications-button.js.es6 | 1 + .../discourse/widgets/topic-notifications-button.js.es6 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 b/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 index 35aefe20475..4e2163122f4 100644 --- a/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 @@ -15,5 +15,6 @@ export default MountWidget.extend({ didInsertElement() { this._super(); + this.dispatch('topic-notifications-button:changed', 'topic-notifications-button'); } }); diff --git a/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 b/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 index 4bf84e56316..bd37c8b4d8a 100644 --- a/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 @@ -91,7 +91,9 @@ export default createWidget('topic-notifications-button', { topicNotificationsButtonChanged(msg) { switch(msg.type) { case 'notification': - this.notificationLevelChanged(msg.id); + if (this.attrs.topic.get('details.notification_level') !== msg.id) { + this.notificationLevelChanged(msg.id); + } break; } }