Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 0d1045e

Browse files
authored
DEV: Update topic-notifications-button mod (#595)
See: discourse/discourse#29237
1 parent 6472f45 commit 0d1045e

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.4.0.beta3-dev: 6472f4593e1a4abbb457288db012ddb10f0b16f5
12
< 3.4.0.beta1-dev: fe725251c1b248c349c38c96432e892c668822c6
23
< 3.3.0.beta2-dev: b796ae3fcc89b48cf777de5ee3a4c21aada9271e
34
< 3.3.0.beta1-dev: 56b0de3896361b6a87523537c8f5b450d2fe0807

assets/javascripts/discourse/initializers/extend-for-assigns.js

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -407,25 +407,23 @@ function initialize(api) {
407407
},
408408
});
409409

410-
api.modifyClass("component:topic-notifications-button", {
411-
pluginId: PLUGIN_ID,
410+
api.modifyClass(
411+
"component:topic-notifications-button",
412+
(Superclass) =>
413+
class extends Superclass {
414+
get reasonText() {
415+
if (
416+
this.currentUser.never_auto_track_topics &&
417+
this.args.topic.get("assigned_to_user.username") ===
418+
this.currentUser.username
419+
) {
420+
return I18n.t("notification_reason.user");
421+
}
412422

413-
@discourseComputed(
414-
"topic",
415-
"topic.details.{notification_level,notifications_reason_id}"
416-
)
417-
notificationReasonText(topic) {
418-
if (
419-
this.currentUser.never_auto_track_topics &&
420-
topic.assigned_to_user &&
421-
topic.assigned_to_user.username === this.currentUser.username
422-
) {
423-
return I18n.t("notification_reason.user");
423+
return super.reasonText(...arguments);
424+
}
424425
}
425-
426-
return this._super(...arguments);
427-
},
428-
});
426+
);
429427

430428
api.addPostSmallActionIcon("assigned", "user-plus");
431429
api.addPostSmallActionIcon("assigned_to_post", "user-plus");

0 commit comments

Comments
 (0)