From bec4af7c874c14b8de05f3f8655be8b397667153 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 15 Feb 2021 22:53:29 +0100 Subject: [PATCH] Fix crash reported by PlayStore (#2707) --- CHANGES.md | 1 + .../vector/app/features/home/room/detail/RoomDetailFragment.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c03227f73d..0914a46132 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Improvements 🙌: Bugfix 🐛: - VoIP : fix audio devices output - Fix crash after initial sync on Dendrite + - Fix crash reported by PlayStore (#2707) Translations 🗣: - diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt index 55294edd76..eee3b5850e 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/RoomDetailFragment.kt @@ -52,6 +52,7 @@ import androidx.core.view.ViewCompat import androidx.core.view.forEach import androidx.core.view.isInvisible import androidx.core.view.isVisible +import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -1030,7 +1031,7 @@ class RoomDetailFragment @Inject constructor( } private fun updateJumpToReadMarkerViewVisibility() { - views.jumpToReadMarkerView.post { + viewLifecycleOwner.lifecycleScope.launchWhenResumed { withState(roomDetailViewModel) { val showJumpToUnreadBanner = when (it.unreadState) { UnreadState.Unknown,