mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 06:39:37 +08:00
FIX: use correct attribute method to get post id from dataset. (#14845)
Because of this bug, the post details were not included in the PMs which are initiated from the user cards in posts. This reverts commit e3e0d025eaf1b5e9ec081b9c6668474234277a25.
This commit is contained in:
parent
0b495e9ad4
commit
d549022afb
@ -206,9 +206,9 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
||||
this._close();
|
||||
},
|
||||
|
||||
composePM(user) {
|
||||
composePM(user, post) {
|
||||
this._close();
|
||||
this.composePrivateMessage(user, this.topic);
|
||||
this.composePrivateMessage(user, post);
|
||||
},
|
||||
|
||||
cancelFilter() {
|
||||
|
@ -63,7 +63,7 @@ export default Mixin.create({
|
||||
}
|
||||
|
||||
const closestArticle = target.closest("article");
|
||||
const postId = closestArticle ? closestArticle.dataset["post-id"] : null;
|
||||
const postId = closestArticle ? closestArticle.dataset.postId : null;
|
||||
const wasVisible = this.visible;
|
||||
const previousTarget = this.cardTarget;
|
||||
|
||||
|
@ -70,14 +70,14 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
||||
});
|
||||
},
|
||||
|
||||
composePrivateMessage(user, topic) {
|
||||
composePrivateMessage(user, post) {
|
||||
const recipients = user ? user.get("username") : "";
|
||||
const reply = topic
|
||||
? `${window.location.protocol}//${window.location.host}${topic.url}`
|
||||
const reply = post
|
||||
? `${window.location.protocol}//${window.location.host}${post.url}`
|
||||
: null;
|
||||
const title = topic
|
||||
const title = post
|
||||
? I18n.t("composer.reference_topic_title", {
|
||||
title: topic.title,
|
||||
title: post.topic.title,
|
||||
})
|
||||
: null;
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
||||
<li class="compose-pm">
|
||||
{{d-button
|
||||
class="btn-primary"
|
||||
action=(action "composePM" this.user)
|
||||
action=(action "composePM" this.user this.post)
|
||||
icon="envelope"
|
||||
label="user.private_message"}}
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user