Revert "Revert "stop listening timeline collection changes when app is not resumed (#7734)""

Upstream fix incoming

This reverts commit 987ca6dec4.

Change-Id: I3cec506b84cf1e469133df5276640d099e3c33de
This commit is contained in:
SpiritCroc 2023-02-22 18:26:20 +01:00
parent 2542d7de83
commit 702142f62f
1 changed files with 2 additions and 1 deletions

View File

@ -1166,6 +1166,7 @@ class TimelineFragment :
notificationDrawerManager.setCurrentThread(timelineArgs.threadTimelineArgs?.rootThreadEventId) notificationDrawerManager.setCurrentThread(timelineArgs.threadTimelineArgs?.rootThreadEventId)
roomDetailPendingActionStore.data?.let { handlePendingAction(it) } roomDetailPendingActionStore.data?.let { handlePendingAction(it) }
roomDetailPendingActionStore.data = null roomDetailPendingActionStore.data = null
views.timelineRecyclerView.adapter = timelineEventController.adapter
} }
private fun handlePendingAction(roomDetailPendingAction: RoomDetailPendingAction) { private fun handlePendingAction(roomDetailPendingAction: RoomDetailPendingAction) {
@ -1184,6 +1185,7 @@ class TimelineFragment :
super.onPause() super.onPause()
notificationDrawerManager.setCurrentRoom(null) notificationDrawerManager.setCurrentRoom(null)
notificationDrawerManager.setCurrentThread(null) notificationDrawerManager.setCurrentThread(null)
views.timelineRecyclerView.adapter = null
} }
private val emojiActivityResultLauncher = registerStartForActivityResult { activityResult -> private val emojiActivityResultLauncher = registerStartForActivityResult { activityResult ->
@ -1322,7 +1324,6 @@ class TimelineFragment :
it.dispatchTo(scrollOnHighlightedEventCallback) it.dispatchTo(scrollOnHighlightedEventCallback)
} }
timelineEventController.addModelBuildListener(modelBuildListener) timelineEventController.addModelBuildListener(modelBuildListener)
views.timelineRecyclerView.adapter = timelineEventController.adapter
views.timelineRecyclerView.addOnScrollListener(object: RecyclerView.OnScrollListener() { views.timelineRecyclerView.addOnScrollListener(object: RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if (dy != 0) { if (dy != 0) {