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

This commit is contained in:
Nikita Fedrunov 2022-12-09 09:42:45 +01:00 committed by GitHub
parent ee737025f2
commit cf59c80100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

1
changelog.d/7643.bugfix Normal file
View file

@ -0,0 +1 @@
[Notifications] Fixed a bug when push notification was automatically dismissed while app is on background

View file

@ -975,6 +975,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) {
@ -993,6 +994,7 @@ class TimelineFragment :
super.onPause()
notificationDrawerManager.setCurrentRoom(null)
notificationDrawerManager.setCurrentThread(null)
views.timelineRecyclerView.adapter = null
}
private val emojiActivityResultLauncher = registerStartForActivityResult { activityResult ->
@ -1058,7 +1060,6 @@ class TimelineFragment :
it.dispatchTo(scrollOnHighlightedEventCallback)
}
timelineEventController.addModelBuildListener(modelBuildListener)
views.timelineRecyclerView.adapter = timelineEventController.adapter
if (vectorPreferences.swipeToReplyIsEnabled()) {
val quickReplyHandler = object : RoomMessageTouchHelperCallback.QuickReplayHandler {