mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-23 03:11:25 +00:00
Update post listing to prefer local image when available (#1858)
This commit is contained in:
parent
1774ecdf6c
commit
1bd705d7bc
1 changed files with 3 additions and 9 deletions
|
@ -310,16 +310,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
const url = post.url;
|
const url = post.url;
|
||||||
const thumbnail = post.thumbnail_url;
|
const thumbnail = post.thumbnail_url;
|
||||||
|
|
||||||
if (url && isImage(url)) {
|
if (thumbnail) {
|
||||||
if (url.includes("pictrs")) {
|
|
||||||
return url;
|
|
||||||
} else if (thumbnail) {
|
|
||||||
return thumbnail;
|
|
||||||
} else {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
} else if (thumbnail) {
|
|
||||||
return thumbnail;
|
return thumbnail;
|
||||||
|
} else if (url && isImage(url)) {
|
||||||
|
return url;
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue