From 0787d7b0aacb598ba48526f7aaf6993598c09443 Mon Sep 17 00:00:00 2001 From: xuwenyang Date: Sat, 22 Jun 2019 00:03:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=B8=8D=E5=8F=AF=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=9C=A8=E4=BB=96=E4=BA=BA=E6=97=A5=E8=AE=B0?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E8=AF=84=E8=AE=BA=202.=20=E6=97=A5=E8=AE=B0?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=A2=9E=E5=8A=A0/=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=AF=84=E8=AE=BA=EF=BC=8C=E7=82=B9=E5=87=BBok?= =?UTF-8?q?=E7=BB=B7=E5=90=8E=E5=88=97=E8=A1=A8=E8=87=AA=E5=8A=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/comment/comment.js | 2 +- src/component/comment/commentList.js | 2 ++ src/page/DiaryDetailPage.js | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/component/comment/comment.js b/src/component/comment/comment.js index e1711b5..8e0a4e8 100644 --- a/src/component/comment/comment.js +++ b/src/component/comment/comment.js @@ -54,7 +54,7 @@ export default class Comment extends Component { { - (isMyDiary || isMyComment) && !expired + (isMyDiary) && !expired ? diff --git a/src/component/comment/commentList.js b/src/component/comment/commentList.js index 7545702..e9b1a8b 100644 --- a/src/component/comment/commentList.js +++ b/src/component/comment/commentList.js @@ -110,6 +110,8 @@ export default class CommentList extends Component { onPress: () => { Api.deleteComment(comment.id) .then(() => { + DeviceEventEmitter.emit(Event.updateComments); + const filterComments = this.state.comments.filter(it => it.id !== comment.id); this.setState({ comments: filterComments diff --git a/src/page/DiaryDetailPage.js b/src/page/DiaryDetailPage.js index 08d5b6b..3ebe889 100644 --- a/src/page/DiaryDetailPage.js +++ b/src/page/DiaryDetailPage.js @@ -116,7 +116,10 @@ export default class DiaryDetailPage extends Component { this.commentListener = DeviceEventEmitter.addListener(Event.updateComments, (param) => { this.setState({needScrollToBottom: true}); + + this.refreshDiary(); this.diaryFull.refreshComment(); + Keyboard.dismiss(); }); }