Skip to content

Commit

Permalink
🐛 Fix user cannot delete their comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Feb 18, 2020
1 parent 201bf9d commit 16d0075
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/controller/comment_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,17 @@ class CommentListInPostState extends State<CommentListInPost> with AutomaticKeep
ConfirmationBottomSheet.show(
context,
children: <Widget>[
if (widget.post.uid == currentUser.uid)
if (_comments[index].fromUserUid == currentUser.uid || widget.post.uid == currentUser.uid)
ConfirmationBottomSheetAction(
icon: Icon(Icons.delete),
text: '删除评论',
onTap: () => confirmDelete(context, _comments[index]),
)
else
ConfirmationBottomSheetAction(
icon: Icon(Icons.reply),
text: '回复评论',
onTap: () => replyTo(index),
),
ConfirmationBottomSheetAction(
icon: Icon(Icons.reply),
text: '回复评论',
onTap: () => replyTo(index),
),
ConfirmationBottomSheetAction(
icon: Icon(Icons.report),
text: '复制评论',
Expand Down

0 comments on commit 16d0075

Please sign in to comment.