DEV: Update topic-notifications-button mod (#595)
See: https://github.com/discourse/discourse/pull/29237
This commit is contained in:
parent
6472f4593e
commit
0d1045e988
|
@ -1,3 +1,4 @@
|
|||
< 3.4.0.beta3-dev: 6472f4593e1a4abbb457288db012ddb10f0b16f5
|
||||
< 3.4.0.beta1-dev: fe725251c1b248c349c38c96432e892c668822c6
|
||||
< 3.3.0.beta2-dev: b796ae3fcc89b48cf777de5ee3a4c21aada9271e
|
||||
< 3.3.0.beta1-dev: 56b0de3896361b6a87523537c8f5b450d2fe0807
|
||||
|
|
|
@ -407,25 +407,23 @@ function initialize(api) {
|
|||
},
|
||||
});
|
||||
|
||||
api.modifyClass("component:topic-notifications-button", {
|
||||
pluginId: PLUGIN_ID,
|
||||
api.modifyClass(
|
||||
"component:topic-notifications-button",
|
||||
(Superclass) =>
|
||||
class extends Superclass {
|
||||
get reasonText() {
|
||||
if (
|
||||
this.currentUser.never_auto_track_topics &&
|
||||
this.args.topic.get("assigned_to_user.username") ===
|
||||
this.currentUser.username
|
||||
) {
|
||||
return I18n.t("notification_reason.user");
|
||||
}
|
||||
|
||||
@discourseComputed(
|
||||
"topic",
|
||||
"topic.details.{notification_level,notifications_reason_id}"
|
||||
)
|
||||
notificationReasonText(topic) {
|
||||
if (
|
||||
this.currentUser.never_auto_track_topics &&
|
||||
topic.assigned_to_user &&
|
||||
topic.assigned_to_user.username === this.currentUser.username
|
||||
) {
|
||||
return I18n.t("notification_reason.user");
|
||||
return super.reasonText(...arguments);
|
||||
}
|
||||
}
|
||||
|
||||
return this._super(...arguments);
|
||||
},
|
||||
});
|
||||
);
|
||||
|
||||
api.addPostSmallActionIcon("assigned", "user-plus");
|
||||
api.addPostSmallActionIcon("assigned_to_post", "user-plus");
|
||||
|
|
Loading…
Reference in New Issue