fix that comments stop loading on scroll

This commit is contained in:
Bnyro 2022-11-26 18:14:12 +01:00
parent 08e9cfefff
commit f1e16191b7

View File

@ -43,7 +43,7 @@ class CommentsSheet(
}
if (comments.isNotEmpty()) {
commentsAdapter = CommentsAdapter(videoId, comments)
setCommentsAdapter(comments)
} else {
fetchComments()
}
@ -52,6 +52,7 @@ class CommentsSheet(
private fun setCommentsAdapter(comments: MutableList<Comment>) {
commentsAdapter = CommentsAdapter(videoId, comments)
binding.optionsRecycler.adapter = commentsAdapter
isLoading = false
}
private fun fetchComments() {
@ -65,7 +66,6 @@ class CommentsSheet(
setCommentsAdapter(response.comments)
nextPage = response.nextpage
onMoreComments.invoke(response.comments, response.nextpage)
isLoading = false
}
}