Skip to content

Commit

Permalink
Fixed some cover images appearing twice in reader if full text
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Nov 30, 2023
1 parent e22fd5a commit 8056af7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ fun ArticleContent(
},
image = viewState.image,
imageFromBody = viewState.imageFromBody,
isFeedText = viewState.textToDisplay == TextToDisplay.DEFAULT,
) {
// Can take a composition or two before viewstate is set to its actual values
if (viewState.articleId > ID_UNSET) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fun ReaderView(
authorDate: String?,
image: String?,
imageFromBody: Boolean,
isFeedText: Boolean,
modifier: Modifier = Modifier,
articleListState: LazyListState = rememberLazyListState(),
articleBody: LazyListScope.() -> Unit,
Expand Down Expand Up @@ -288,7 +289,8 @@ fun ReaderView(
}
}

if (!imageFromBody && image != null) {
// Don't show image for full text articles since it's typically inside the full article
if (isFeedText && !imageFromBody && image != null) {
item {
BoxWithConstraints(
modifier =
Expand Down Expand Up @@ -353,6 +355,7 @@ private fun ReaderPreview() {
authorDate = "2018-01-02",
image = "https://cowboyprogrammer.org/images/2017/10/gimp_image_mode_index.png",
imageFromBody = false,
isFeedText = true,
) {}
}
}
Expand Down

0 comments on commit 8056af7

Please sign in to comment.