]> Untitled Git - lemmy-ui.git/commitdiff
Merge pull request #1757 from jsit/fix/expand-button-when-no-link
authorSleeplessOne1917 <abias1122@gmail.com>
Sun, 2 Jul 2023 23:23:08 +0000 (23:23 +0000)
committerGitHub <noreply@github.com>
Sun, 2 Jul 2023 23:23:08 +0000 (23:23 +0000)
fix: Post expand button was not showing if body-only post

src/shared/components/post/post-listing.tsx

index 462087f34a13ffe1301d803f52ab735bb3ff6e3d..654f92dceb05518eb7315195965f1f24aa3794de 100644 (file)
@@ -497,12 +497,12 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
           </h5>
 
           {/**
-           * If there is a URL, an embed title, and we were not told to show the
-           * body by the parent component, show the MetadataCard/body toggle.
+           * If there is (a) a URL and an embed title, or (b) a post body, and
+           * we were not told to show the body by the parent component, show the
+           * MetadataCard/body toggle.
            */}
           {!this.props.showBody &&
-            post.url &&
-            post.embed_title &&
+            ((post.url && post.embed_title) || post.body) &&
             this.showPreviewButton()}
 
           {post.removed && (