Reduce time required before updating read marker

Change-Id: Ia242b3e031deac313e7db161ccf7dae64ed66e7c
This commit is contained in:
SpiritCroc 2022-03-16 15:39:46 +01:00
parent d92ce97f84
commit 922b62f9f5

View file

@ -947,12 +947,12 @@ class TimelineViewModel @AssistedInject constructor(
}
private fun observeEventDisplayedActions() {
// We are buffering scroll events for half a second
// We are buffering scroll events 200 ms
// and keep the most recent one to set the read receipt on.
visibleEventsSource
.stream()
.chunk(500)
.chunk(200)
.filter { it.isNotEmpty() }
.onEach { actions ->
val bufferedMostRecentDisplayedEvent = actions.minByOrNull { it.event.indexOfEvent() }?.event ?: return@onEach