From b01a3cfaa38d17334ee77b29a02ba9f2f3b1b8a5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 7 Nov 2024 12:03:07 -0500 Subject: [PATCH] Fix fullsize post image (#2797) * 0.19.6-beta.8 * 0.19.6-beta.9 * 0.19.6-beta.14 * Using full-size image column, not thumbnail. - Fixes #2796 --- src/shared/components/post/post-listing.tsx | 44 +++++++-------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index fd51f2fd..00e906ed 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -273,18 +273,22 @@ export class PostListing extends Component { } get img() { - const { post } = this.postView; - if (this.isoData.showAdultConsentModal) { return <>; } - if (this.imageSrc) { + // Use the full-size image for expands + const post = this.postView.post; + const url = post.url; + const thumbnail = post.thumbnail_url; + const imageSrc = url && isImage(url) ? url : thumbnail; + + if (imageSrc) { return ( <>
- - + +
@@ -293,7 +297,7 @@ export class PostListing extends Component { className="p-0 border-0 bg-transparent d-inline-block" onClick={linkEvent(this, this.handleImageExpandClick)} > - +
@@ -315,26 +319,12 @@ export class PostListing extends Component { ); } - get imageSrc(): string | undefined { - const post = this.postView.post; - const url = post.url; - const thumbnail = post.thumbnail_url; - - if (thumbnail) { - return thumbnail; - } else if (url && isImage(url)) { - return url; - } else { - return undefined; - } - } - thumbnail() { const post = this.postView.post; const url = post.url; const thumbnail = post.thumbnail_url; - if (!this.props.hideImage && url && isImage(url) && this.imageSrc) { + if (!this.props.hideImage && url && isImage(url) && thumbnail) { return ( ); - } else if ( - !this.props.hideImage && - url && - thumbnail && - this.imageSrc && - !isVideo(url) - ) { + } else if (!this.props.hideImage && url && thumbnail && !isVideo(url)) { return ( { title={url} target={this.linkTarget} > - {this.imgThumb(this.imageSrc)} + {this.imgThumb(thumbnail)}