mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix: observe comment count outside of lifecycle aware block (#6961)
This commit is contained in:
parent
844b7d11ba
commit
31ec3bb3c4
@ -116,19 +116,17 @@ class CommentsMainFragment : Fragment() {
|
|||||||
commentPagingAdapter.submitData(it)
|
commentPagingAdapter.submitData(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launch {
|
|
||||||
viewModel.commentCountLiveData.observe(viewLifecycleOwner) { commentCount ->
|
|
||||||
if (commentCount == null) return@observe
|
|
||||||
|
|
||||||
commentsSheet?.updateFragmentInfo(
|
|
||||||
false,
|
|
||||||
getString(R.string.comments_count, commentCount.formatShort())
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.commentCountLiveData.observe(viewLifecycleOwner) { commentCount ->
|
||||||
|
if (commentCount == null) return@observe
|
||||||
|
|
||||||
|
commentsSheet?.updateFragmentInfo(
|
||||||
|
false,
|
||||||
|
getString(R.string.comments_count, commentCount.formatShort())
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user