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