Fix some bugs

This commit is contained in:
Chi Vinh Le
2017-12-12 17:28:38 +01:00
parent b12d5f6bd7
commit 51bd109f13
2 changed files with 2 additions and 3 deletions
@@ -209,7 +209,7 @@ class Comment extends React.Component {
Comment.propTypes = {
viewUserDetail: PropTypes.func.isRequired,
acceptComment: PropTypes.func.isRequired,
selectComment: PropTypes.func.isRequired,
selectComment: PropTypes.func,
rejectComment: PropTypes.func.isRequired,
onClick: PropTypes.func,
className: PropTypes.string,
@@ -129,7 +129,7 @@ class ModerationQueue extends React.Component {
}
// Scroll to selected comment.
if (prev.selectedCommentId !== this.props.selectedCommentId) {
if (prev.selectedCommentId !== this.props.selectedCommentId && this.listRef) {
const view = this.getVisibleComments();
const index = view.findIndex(({id}) => id === this.props.selectedCommentId);
@@ -298,7 +298,6 @@ class ModerationQueue extends React.Component {
rejectComment={props.rejectComment}
currentAsset={props.currentAsset}
currentUserId={this.props.currentUserId}
selectComment={() => this.props.selectCommentId(comment.id)}
/>;
</div>
);