mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +08:00
1. 不可删除自己在他人日记上的评论
2. 日记详情页增加/删除评论,点击ok绷后列表自动更新图标
This commit is contained in:
parent
6a3c7333ad
commit
0787d7b0aa
3 changed files with 6 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue