diff --git a/src/component/comment/comment.js b/src/component/comment/comment.js index 89ea4a1..c399883 100644 --- a/src/component/comment/comment.js +++ b/src/component/comment/comment.js @@ -30,8 +30,13 @@ export default class Comment extends Component { let isMyComment = this.state.isMyComment; let expired = this.state.expired; + const isNewComment = this.props.newCommentIds != null + && this.props.newCommentIds.some(it => it === comment.id); + + const bgActive = isNewComment ? {backgroundColor: Color.textSelect} : null; + return ( - + diff --git a/src/component/comment/commentList.js b/src/component/comment/commentList.js index e9b1a8b..d24b944 100644 --- a/src/component/comment/commentList.js +++ b/src/component/comment/commentList.js @@ -149,6 +149,8 @@ export default class CommentList extends Component { return ( this._onCommentPress(item)}> { this.setState({ + mounting: false, refreshing: false }); }); @@ -210,6 +215,21 @@ export default class NotebookDiaryList extends Component { return null; } + if(this.state.refreshing) { + return (); + } + + if(!this.state.mounting && (!this.state.diaries || this.state.diaries.length == 0)) { + return ( + + ); + } + let expired = this.notebook.isExpired; let isMine = this.isMine; diff --git a/src/component/notification/notificationList.js b/src/component/notification/notificationList.js index 82b8533..5db4564 100644 --- a/src/component/notification/notificationList.js +++ b/src/component/notification/notificationList.js @@ -115,7 +115,9 @@ export default class NotificationList extends Component { } }, passProps: { - diaryId: msg.link_id + diaryId: msg.link_id, + newCommentIds: msg.list.map(it => it.content.comment_id), + needScrollToBottom: true } } }); diff --git a/src/page/DiaryDetailPage.js b/src/page/DiaryDetailPage.js index 289deb7..a426037 100644 --- a/src/page/DiaryDetailPage.js +++ b/src/page/DiaryDetailPage.js @@ -201,7 +201,7 @@ export default class DiaryDetailPage extends Component { this.scroll = r} style={{flex: 1}} onContentSizeChange={(width, height) => { - if(this.state.needScrollToBottom) { + if(this.props.needScrollToBottom || this.state.needScrollToBottom) { this.scroll.scrollTo({y: height}); this.setState({needScrollToBottom: false}); }