fix: popup spam

This commit is contained in:
rebelonion 2024-03-10 03:59:24 -05:00
parent 913d74b285
commit 867a4f36b3

View file

@ -176,10 +176,10 @@ class CommentsFragment : Fragment() {
object : View.OnTouchListener {
override fun onTouch(v: View?, event: MotionEvent?): Boolean {
if (event?.action == MotionEvent.ACTION_UP) {
if (pagesLoaded < totalPages) {
if (!binding.commentsList.canScrollVertically(1) && !isFetching &&
(binding.commentsList.layoutManager as LinearLayoutManager).findLastVisibleItemPosition() == (binding.commentsList.adapter!!.itemCount - 1)
) {
if (pagesLoaded < totalPages) {
binding.commentBottomRefresh.visibility = View.VISIBLE
loadMoreComments()
lifecycleScope.launch {
@ -188,11 +188,11 @@ class CommentsFragment : Fragment() {
binding.commentBottomRefresh.visibility = View.GONE
}
}
}
} else {
snackString("No more comments")
}
}
}
return false
}