Update post listing to prefer local image when available (#1858)

This commit is contained in:
Lemmus.org 2023-07-10 07:22:12 -07:00 committed by GitHub
parent 1774ecdf6c
commit 1bd705d7bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;
}