fix: false message about no comments

This commit is contained in:
Nikita 2024-03-11 18:54:34 +03:00
parent 85d9cb3a46
commit 8c55f30b02

View File

@ -74,7 +74,7 @@ class CommentsMainFragment : Fragment() {
commentPagingAdapter.loadStateFlow.collect {
binding.progress.isVisible = it.refresh is LoadState.Loading
if (it.append is LoadState.NotLoading && it.append.endOfPaginationReached) {
if (it.append is LoadState.NotLoading && it.append.endOfPaginationReached && commentPagingAdapter.itemCount == 0) {
binding.errorTV.text = getString(R.string.no_comments_available)
binding.errorTV.isVisible = true
return@collect