Skip to content

Commit

Permalink
Only show user instance on comment instance bottom sheet action (#1658)
Browse files Browse the repository at this point in the history
fix: comment action bottom sheet instance only shows user instance
  • Loading branch information
hjiangsu authored Jan 16, 2025
1 parent e6b2e0b commit 03b8d1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/comment/widgets/comment_action_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@ class _CommentActionBottomSheetState extends State<CommentActionBottomSheet> {
String? generateSubtitle(GeneralCommentAction page) {
CommentView commentView = widget.commentView;

String? communityInstance = fetchInstanceNameFromUrl(commentView.community.actorId);
String? userInstance = fetchInstanceNameFromUrl(commentView.creator.actorId);

switch (page) {
case GeneralCommentAction.user:
return generateUserFullName(context, commentView.creator.name, commentView.creator.displayName, fetchInstanceNameFromUrl(commentView.creator.actorId));
case GeneralCommentAction.instance:
return (communityInstance == userInstance) ? '$communityInstance' : '$communityInstance • $userInstance';
return userInstance;
default:
return null;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/comment/widgets/general_comment_action_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ class _GeneralCommentActionBottomSheetPageState extends State<GeneralCommentActi
String? generateSubtitle(GeneralCommentAction page) {
CommentView commentView = widget.commentView;

String? communityInstance = fetchInstanceNameFromUrl(commentView.community.actorId);
String? userInstance = fetchInstanceNameFromUrl(commentView.creator.actorId);

switch (page) {
case GeneralCommentAction.user:
return generateUserFullName(context, commentView.creator.name, commentView.creator.displayName, fetchInstanceNameFromUrl(commentView.creator.actorId));
case GeneralCommentAction.instance:
return (communityInstance == userInstance) ? '$communityInstance' : '$communityInstance • $userInstance';
return userInstance;
default:
return null;
}
Expand Down

0 comments on commit 03b8d1c

Please sign in to comment.