PERF: more efficient retaining of discussion list items

This commit is contained in:
Toby Zerner 2015-07-28 22:39:03 +09:30
parent 591151e24e
commit f9fc9dfb72

View File

@ -44,6 +44,10 @@ export default class DiscussionListItem extends Component {
}
view() {
const retain = this.subtree.retain();
if (retain) return retain;
const discussion = this.props.discussion;
const startUser = discussion.startUser();
const isUnread = discussion.isUnread();
@ -52,7 +56,7 @@ export default class DiscussionListItem extends Component {
const relevantPosts = this.props.params.q ? discussion.relevantPosts() : [];
const controls = DiscussionControls.controls(discussion, this).toArray();
return this.subtree.retain() || (
return (
<div className={'DiscussionListItem ' + (this.active() ? 'active' : '')}>
{controls.length ? Dropdown.component({