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

This makes the chat view get destroyed onPause, leading to
jump-to-bottom when clicking links, opening threads etc.

This reverts commit cf59c80100.

Change-Id: I56ae7027d0488013251bc88edd0e47a19dead315
This commit is contained in:
SpiritCroc 2022-12-16 10:15:50 +01:00
parent 05fc840b3b
commit 987ca6dec4

View file

@ -1159,7 +1159,6 @@ 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) {
@ -1178,7 +1177,6 @@ class TimelineFragment :
super.onPause()
notificationDrawerManager.setCurrentRoom(null)
notificationDrawerManager.setCurrentThread(null)
views.timelineRecyclerView.adapter = null
}
private val emojiActivityResultLauncher = registerStartForActivityResult { activityResult ->
@ -1317,6 +1315,7 @@ 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) {