Skip to content

Commit

Permalink
Handle reader view when there is no content and just title
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Jan 24, 2024
1 parent 9f68e30 commit 8b282b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ class ReaderPresenter(

val htmlContent =
if (content.isNotBlank()) {
// If the content parsed by readability is not an HTML, it will return
// null. In that scenario we simply pass the original content
extractArticleHtmlContent(postLink, content) ?: content
} else {
null
}
// If the content parsed by readability is not an HTML, it will return
// null. In that scenario we simply pass the original content
extractArticleHtmlContent(postLink, content) ?: content
} else {
null
}
.orEmpty()

_state.update {
it.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ internal data class ReaderState(

val hasContent: Boolean
get() =
!content.isNullOrBlank() &&
feed != null &&
!publishedAt.isNullOrBlank() &&
!title.isNullOrBlank()
content != null && feed != null && !publishedAt.isNullOrBlank() && !title.isNullOrBlank()

companion object {

Expand Down

0 comments on commit 8b282b9

Please sign in to comment.