Skip to content

Commit

Permalink
Fix share text post (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Aug 6, 2024
1 parent a31f9c2 commit 90c78c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/community/utils/post_card_action_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:thunder/community/bloc/community_bloc.dart';
import 'package:thunder/community/enums/community_action.dart';
import 'package:thunder/community/widgets/post_card_metadata.dart';
import 'package:thunder/core/enums/full_name.dart';
import 'package:thunder/core/enums/media_type.dart';
import 'package:thunder/core/models/post_view_media.dart';
import 'package:thunder/core/singletons/lemmy_client.dart';
import 'package:thunder/feed/bloc/feed_bloc.dart';
Expand Down Expand Up @@ -398,7 +399,10 @@ void showPostActionBottomModalSheet(

// Remove the share link option if there is no link
// Or if the media link is the same as the external link
if (postViewMedia.media.isEmpty || postViewMedia.media.first.originalUrl == postViewMedia.media.first.imageUrl || postViewMedia.media.first.originalUrl == postViewMedia.media.first.mediaUrl) {
if (postViewMedia.media.isEmpty ||
postViewMedia.media.first.mediaType == MediaType.text ||
postViewMedia.media.first.originalUrl == postViewMedia.media.first.imageUrl ||
postViewMedia.media.first.originalUrl == postViewMedia.media.first.mediaUrl) {
sharePostCardActions.removeWhere((extendedAction) => extendedAction.postCardAction == PostCardAction.shareLink);
}

Expand Down

0 comments on commit 90c78c7

Please sign in to comment.