Don't pass topic down to the widgets

This commit is contained in:
Robin Ward 2016-02-24 10:44:27 -05:00
parent 84919ca43a
commit 015eb47ea0
2 changed files with 2 additions and 3 deletions

View File

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

View File

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