Skip to content

Commit

Permalink
🐛 Blocked user cannot be blocked again.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Feb 16, 2020
1 parent 79759eb commit c4d3989
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
14 changes: 9 additions & 5 deletions lib/pages/post/post_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ class PostDetailPageState extends State<PostDetailPage> {
ConfirmationBottomSheet.show(
context,
children: <Widget>[
ConfirmationBottomSheetAction(
icon: Icon(Icons.visibility_off),
text: '屏蔽此人',
onTap: () => confirmBlock(context),
),
if (!UserAPI.blacklist.contains(BlacklistUser(
uid: widget.post.uid,
username: widget.post.nickname,
)))
ConfirmationBottomSheetAction(
icon: Icon(Icons.visibility_off),
text: '屏蔽此人',
onTap: () => confirmBlock(context),
),
ConfirmationBottomSheetAction(
icon: Icon(Icons.report),
text: '举报动态',
Expand Down
11 changes: 6 additions & 5 deletions lib/widgets/cards/post_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,12 @@ class _PostCardState extends State<PostCard> {
ConfirmationBottomSheet.show(
context,
children: <Widget>[
ConfirmationBottomSheetAction(
icon: Icon(Icons.visibility_off),
text: '屏蔽此人',
onTap: () => confirmBlock(context),
),
if (!UserAPI.blacklist.contains(widget.post.uid))
ConfirmationBottomSheetAction(
icon: Icon(Icons.visibility_off),
text: '屏蔽此人',
onTap: () => confirmBlock(context),
),
ConfirmationBottomSheetAction(
icon: Icon(Icons.report),
text: '举报动态',
Expand Down

0 comments on commit c4d3989

Please sign in to comment.