mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: throttles topic tracking shortcut and enforces topic id (#9159)
This commit is contained in:
@@ -28,6 +28,17 @@ export default Component.extend({
|
||||
},
|
||||
|
||||
_changeTopicNotificationLevel(level) {
|
||||
// this change is coming from a keyboard event
|
||||
if (level.event) {
|
||||
const topicSectionNode = level.event.target.querySelector("#topic");
|
||||
if (topicSectionNode && topicSectionNode.dataset.topicId) {
|
||||
const topicId = parseInt(topicSectionNode.dataset.topicId, 10);
|
||||
if (topicId && topicId !== this.topic.id) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (level.id !== this.notificationLevel) {
|
||||
this.topic.details.updateNotifications(level.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user