DEV: Update topic-notifications-button mod (#595)

See: https://github.com/discourse/discourse/pull/29237
This commit is contained in:
Jarek Radosz 2024-10-21 16:56:38 +02:00 committed by GitHub
parent 6472f4593e
commit 0d1045e988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 17 deletions

View File

@ -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

View File

@ -407,25 +407,23 @@ function initialize(api) {
},
});
api.modifyClass("component:topic-notifications-button", {
pluginId: PLUGIN_ID,
@discourseComputed(
"topic",
"topic.details.{notification_level,notifications_reason_id}"
)
notificationReasonText(topic) {
api.modifyClass(
"component:topic-notifications-button",
(Superclass) =>
class extends Superclass {
get reasonText() {
if (
this.currentUser.never_auto_track_topics &&
topic.assigned_to_user &&
topic.assigned_to_user.username === this.currentUser.username
this.args.topic.get("assigned_to_user.username") ===
this.currentUser.username
) {
return I18n.t("notification_reason.user");
}
return this._super(...arguments);
},
});
return super.reasonText(...arguments);
}
}
);
api.addPostSmallActionIcon("assigned", "user-plus");
api.addPostSmallActionIcon("assigned_to_post", "user-plus");