From f32e4523e8eb7108e68a64636beb190e217fcb84 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 12 Dec 2017 12:53:54 +0100 Subject: [PATCH] Make view more coments work with virtualized --- .../src/routes/Moderation/components/ModerationQueue.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js index a2c09c5df..d73cd04a5 100644 --- a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js +++ b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js @@ -119,7 +119,7 @@ class ModerationQueue extends React.Component { } viewNewComments = () => { - this.setState(resetCursors); + this.setState(resetCursors, () => this.reflowList()); }; reflowList = throttle(() => { @@ -155,7 +155,9 @@ class ModerationQueue extends React.Component { parent, style // Style object to be applied to row (to position it) }) => { - if (index === parent.props.rowCount - 1) { + const view = this.getVisibleComments(); + const rowCount = view.length + 1; + if (index === rowCount - 1) { return ( ); } - const comment = this.props.comments[index]; + + const comment = view[index]; return (