fix: observe comment count outside of lifecycle aware block (#6961)

This commit is contained in:
Thomas W. 2025-01-16 17:03:39 +01:00 committed by GitHub
parent 844b7d11ba
commit 31ec3bb3c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,8 +116,9 @@ class CommentsMainFragment : Fragment() {
commentPagingAdapter.submitData(it)
}
}
}
}
launch {
viewModel.commentCountLiveData.observe(viewLifecycleOwner) { commentCount ->
if (commentCount == null) return@observe
@ -127,9 +128,6 @@ class CommentsMainFragment : Fragment() {
)
}
}
}
}
}
override fun onPause() {
super.onPause()