1. 不可删除自己在他人日记上的评论

2. 日记详情页增加/删除评论,点击ok绷后列表自动更新图标
This commit is contained in:
xuwenyang 2019-06-22 00:03:08 +08:00
parent 6a3c7333ad
commit 0787d7b0aa
3 changed files with 6 additions and 1 deletions

View file

@ -54,7 +54,7 @@ export default class Comment extends Component {
</View>
{
(isMyDiary || isMyComment) && !expired
(isMyDiary) && !expired
? <TouchableOpacity onPress={this.props.onCommentAction} style={localStyle.moreIcon}>
<Ionicons name="ios-more" size={24} color={Color.inactiveText} />
</TouchableOpacity>

View file

@ -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

View file

@ -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();
});
}