1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

update codes for slate (#3170)

This commit is contained in:
Michael An
2019-03-25 11:49:47 +08:00
committed by Daniel Pan
parent 8dec69ca4b
commit 774143554f
3 changed files with 16 additions and 6 deletions

View File

@@ -10,7 +10,8 @@ import '../../css/comments-list.css';
const { username, repoID, filePath } = window.app.pageOptions;
const CommentPanelPropTypes = {
toggleCommentPanel: PropTypes.func.isRequired
toggleCommentPanel: PropTypes.func.isRequired,
commentsNumber: PropTypes.number,
};
class CommentPanel extends React.Component {
@@ -75,6 +76,12 @@ class CommentPanel extends React.Component {
this.listComments();
}
componentWillReceiveProps(nextProps) {
if (this.props.commentsNumber !== nextProps.commentsNumber) {
this.listComments();
}
}
render() {
return (
<div className="seafile-comment">