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.4.0.beta1-dev: fe725251c1b248c349c38c96432e892c668822c6
|
||||||
< 3.3.0.beta2-dev: b796ae3fcc89b48cf777de5ee3a4c21aada9271e
|
< 3.3.0.beta2-dev: b796ae3fcc89b48cf777de5ee3a4c21aada9271e
|
||||||
< 3.3.0.beta1-dev: 56b0de3896361b6a87523537c8f5b450d2fe0807
|
< 3.3.0.beta1-dev: 56b0de3896361b6a87523537c8f5b450d2fe0807
|
||||||
|
|
|
@ -407,25 +407,23 @@ function initialize(api) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
api.modifyClass("component:topic-notifications-button", {
|
api.modifyClass(
|
||||||
pluginId: PLUGIN_ID,
|
"component:topic-notifications-button",
|
||||||
|
(Superclass) =>
|
||||||
@discourseComputed(
|
class extends Superclass {
|
||||||
"topic",
|
get reasonText() {
|
||||||
"topic.details.{notification_level,notifications_reason_id}"
|
|
||||||
)
|
|
||||||
notificationReasonText(topic) {
|
|
||||||
if (
|
if (
|
||||||
this.currentUser.never_auto_track_topics &&
|
this.currentUser.never_auto_track_topics &&
|
||||||
topic.assigned_to_user &&
|
this.args.topic.get("assigned_to_user.username") ===
|
||||||
topic.assigned_to_user.username === this.currentUser.username
|
this.currentUser.username
|
||||||
) {
|
) {
|
||||||
return I18n.t("notification_reason.user");
|
return I18n.t("notification_reason.user");
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._super(...arguments);
|
return super.reasonText(...arguments);
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
api.addPostSmallActionIcon("assigned", "user-plus");
|
api.addPostSmallActionIcon("assigned", "user-plus");
|
||||||
api.addPostSmallActionIcon("assigned_to_post", "user-plus");
|
api.addPostSmallActionIcon("assigned_to_post", "user-plus");
|
||||||
|
|
Loading…
Reference in New Issue