]> Untitled Git - lemmy-ui.git/commitdiff
Update post listing to prefer local image when available (#1858)
authorLemmus.org <137361180+lemmus-org@users.noreply.github.com>
Mon, 10 Jul 2023 14:22:12 +0000 (07:22 -0700)
committerGitHub <noreply@github.com>
Mon, 10 Jul 2023 14:22:12 +0000 (10:22 -0400)
src/shared/components/post/post-listing.tsx

index eb4dc8d974807547758e5d785ece3debf0510c35..30b18659fcd67ebcee26abc44fa4321b4b10f9c6 100644 (file)
@@ -310,16 +310,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
     const url = post.url;
     const thumbnail = post.thumbnail_url;
 
-    if (url && isImage(url)) {
-      if (url.includes("pictrs")) {
-        return url;
-      } else if (thumbnail) {
-        return thumbnail;
-      } else {
-        return url;
-      }
-    } else if (thumbnail) {
+    if (thumbnail) {
       return thumbnail;
+    } else if (url && isImage(url)) {
+      return url;
     } else {
       return undefined;
     }