mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 13:39:36 -06:00
Don't pass topic
down to the widgets
This commit is contained in:
parent
84919ca43a
commit
015eb47ea0
@ -85,7 +85,6 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
|
||||
|
||||
const postAtts = transformBasicPost(post);
|
||||
|
||||
postAtts.topic = topic;
|
||||
postAtts.topicId = topic.id;
|
||||
postAtts.topicOwner = details.created_by.id === post.user_id;
|
||||
postAtts.post_type = postType;
|
||||
@ -105,6 +104,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
|
||||
postAtts.actionCode = post.action_code;
|
||||
postAtts.actionCodeWho = post.action_code_who;
|
||||
postAtts.userCustomFields = post.user_custom_fields;
|
||||
postAtts.topicUrl = topic.get('url');
|
||||
|
||||
const showPMMap = topic.archetype === 'private_message' && post.post_number === 1;
|
||||
if (showPMMap) {
|
||||
@ -118,7 +118,6 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
|
||||
const showTopicMap = showPMMap || (post.post_number === 1 && topic.archetype === 'regular' && topic.posts_count > 1);
|
||||
if (showTopicMap) {
|
||||
postAtts.showTopicMap = true;
|
||||
postAtts.topicUrl = topic.get('url');
|
||||
postAtts.topicCreatedAt = topic.created_at;
|
||||
postAtts.createdByUsername = details.created_by.username;
|
||||
postAtts.createdByAvatarTemplate = details.created_by.avatar_template;
|
||||
|
@ -145,7 +145,7 @@ export default class PostCooked {
|
||||
}
|
||||
|
||||
_urlForPostNumber(postNumber) {
|
||||
return (postNumber > 0) ? `${this.attrs.topic.get('url')}/${postNumber}` : this.attrs.topic.get('url');
|
||||
return (postNumber > 0) ? `${this.attrs.topicUrl}/${postNumber}` : this.attrs.topicUrl;
|
||||
}
|
||||
|
||||
_updateQuoteElements($aside, desc) {
|
||||
|
Loading…
Reference in New Issue
Block a user