FIX: Include topic details when PMing
We used to do this and at some point regressed when we lost a reference to the `post` object. This restores the old behaviour.
This commit is contained in:
parent
cfc62dbace
commit
e3e0d025ea
|
@ -206,9 +206,9 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
|||
this._close();
|
||||
},
|
||||
|
||||
composePM(user, post) {
|
||||
composePM(user) {
|
||||
this._close();
|
||||
this.composePrivateMessage(user, post);
|
||||
this.composePrivateMessage(user, this.topic);
|
||||
},
|
||||
|
||||
cancelFilter() {
|
||||
|
|
|
@ -70,14 +70,14 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
|||
});
|
||||
},
|
||||
|
||||
composePrivateMessage(user, post) {
|
||||
composePrivateMessage(user, topic) {
|
||||
const recipients = user ? user.get("username") : "";
|
||||
const reply = post
|
||||
? `${window.location.protocol}//${window.location.host}${post.url}`
|
||||
const reply = topic
|
||||
? `${window.location.protocol}//${window.location.host}${topic.url}`
|
||||
: null;
|
||||
const title = post
|
||||
const title = topic
|
||||
? I18n.t("composer.reference_topic_title", {
|
||||
title: post.topic.title,
|
||||
title: topic.title,
|
||||
})
|
||||
: null;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<li class="compose-pm">
|
||||
{{d-button
|
||||
class="btn-primary"
|
||||
action=(action "composePM" this.user this.post)
|
||||
action=(action "composePM" this.user)
|
||||
icon="envelope"
|
||||
label="user.private_message"}}
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue