make sure we update the timers on the proper thread

This commit is contained in:
tibbi 2021-09-24 22:21:32 +02:00
parent fe08a533a8
commit 3baf841211

View file

@ -92,8 +92,8 @@ class TimerFragment : Fragment() {
private fun refreshTimers(scrollToLatest: Boolean = false) { private fun refreshTimers(scrollToLatest: Boolean = false) {
activity?.timerHelper?.getTimers { timers -> activity?.timerHelper?.getTimers { timers ->
timerAdapter.submitList(timers) { activity?.runOnUiThread {
view.timers_list.post { timerAdapter.submitList(timers) {
if (getView() != null) { if (getView() != null) {
if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) { if (timerPositionToScrollTo != INVALID_POSITION && timerAdapter.itemCount > timerPositionToScrollTo) {
view.timers_list.scrollToPosition(timerPositionToScrollTo) view.timers_list.scrollToPosition(timerPositionToScrollTo)