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
app/assets/javascripts/discourse

View file

@ -85,7 +85,6 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
const postAtts = transformBasicPost(post); const postAtts = transformBasicPost(post);
postAtts.topic = topic;
postAtts.topicId = topic.id; postAtts.topicId = topic.id;
postAtts.topicOwner = details.created_by.id === post.user_id; postAtts.topicOwner = details.created_by.id === post.user_id;
postAtts.post_type = postType; postAtts.post_type = postType;
@ -105,6 +104,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
postAtts.actionCode = post.action_code; postAtts.actionCode = post.action_code;
postAtts.actionCodeWho = post.action_code_who; postAtts.actionCodeWho = post.action_code_who;
postAtts.userCustomFields = post.user_custom_fields; postAtts.userCustomFields = post.user_custom_fields;
postAtts.topicUrl = topic.get('url');
const showPMMap = topic.archetype === 'private_message' && post.post_number === 1; const showPMMap = topic.archetype === 'private_message' && post.post_number === 1;
if (showPMMap) { 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); const showTopicMap = showPMMap || (post.post_number === 1 && topic.archetype === 'regular' && topic.posts_count > 1);
if (showTopicMap) { if (showTopicMap) {
postAtts.showTopicMap = true; postAtts.showTopicMap = true;
postAtts.topicUrl = topic.get('url');
postAtts.topicCreatedAt = topic.created_at; postAtts.topicCreatedAt = topic.created_at;
postAtts.createdByUsername = details.created_by.username; postAtts.createdByUsername = details.created_by.username;
postAtts.createdByAvatarTemplate = details.created_by.avatar_template; postAtts.createdByAvatarTemplate = details.created_by.avatar_template;

View file

@ -145,7 +145,7 @@ export default class PostCooked {
} }
_urlForPostNumber(postNumber) { _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) { _updateQuoteElements($aside, desc) {