From 1c1d4f5f371a53797e50430c064c2e415cb72aaf Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 28 Jul 2015 22:39:03 +0930 Subject: [PATCH] PERF: more efficient retaining of discussion list items --- js/forum/src/components/DiscussionListItem.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/forum/src/components/DiscussionListItem.js b/js/forum/src/components/DiscussionListItem.js index 4260d7a33..8adc70504 100644 --- a/js/forum/src/components/DiscussionListItem.js +++ b/js/forum/src/components/DiscussionListItem.js @@ -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 (
{controls.length ? Dropdown.component({