Skip to content

Commit cf59c80

Browse files
authored
stop listening timeline collection changes when app is not resumed (#7734)
1 parent ee73702 commit cf59c80

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/7643.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Notifications] Fixed a bug when push notification was automatically dismissed while app is on background

vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ class TimelineFragment :
975975
notificationDrawerManager.setCurrentThread(timelineArgs.threadTimelineArgs?.rootThreadEventId)
976976
roomDetailPendingActionStore.data?.let { handlePendingAction(it) }
977977
roomDetailPendingActionStore.data = null
978+
views.timelineRecyclerView.adapter = timelineEventController.adapter
978979
}
979980

980981
private fun handlePendingAction(roomDetailPendingAction: RoomDetailPendingAction) {
@@ -993,6 +994,7 @@ class TimelineFragment :
993994
super.onPause()
994995
notificationDrawerManager.setCurrentRoom(null)
995996
notificationDrawerManager.setCurrentThread(null)
997+
views.timelineRecyclerView.adapter = null
996998
}
997999

9981000
private val emojiActivityResultLauncher = registerStartForActivityResult { activityResult ->
@@ -1058,7 +1060,6 @@ class TimelineFragment :
10581060
it.dispatchTo(scrollOnHighlightedEventCallback)
10591061
}
10601062
timelineEventController.addModelBuildListener(modelBuildListener)
1061-
views.timelineRecyclerView.adapter = timelineEventController.adapter
10621063

10631064
if (vectorPreferences.swipeToReplyIsEnabled()) {
10641065
val quickReplyHandler = object : RoomMessageTouchHelperCallback.QuickReplayHandler {

0 commit comments

Comments
 (0)