diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/SendingEventsDataSource.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/SendingEventsDataSource.kt index cb61222de7..637267a9b1 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/SendingEventsDataSource.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/SendingEventsDataSource.kt @@ -45,9 +45,11 @@ internal class RealmSendingEventsDataSource( private var frozenSendingTimelineEvents: RealmList? = null private val sendingTimelineEventsListener = RealmChangeListener> { events -> - uiEchoManager.onSentEventsInDatabase(events.map { it.eventId }) - updateFrozenResults(events) - onEventsUpdated(false) + if (events.isValid) { + uiEchoManager.onSentEventsInDatabase(events.map { it.eventId }) + updateFrozenResults(events) + onEventsUpdated(false) + } } override fun start() { diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt index 1eb6635df0..98b7473894 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt @@ -2393,7 +2393,6 @@ class TimelineFragment @Inject constructor( .setCancelable(true) .setNegativeButton(R.string.action_not_now) { _, _ -> } .setPositiveButton(R.string.action_try_it_out) { _, _ -> - timelineViewModel.onCleared() // We should first clear our viewModel threadsManager.enableThreadsAndRestart(it) } .show()