Reduce thrashing on multiple identity change events.

This commit is contained in:
Cody Henthorne
2026-05-12 15:13:04 -04:00
committed by Michelle Tang
parent 0cf7705d4f
commit 2e9fd87b06
@@ -329,7 +329,8 @@ class ConversationViewModel(
recipientRepository.groupRecord
) { _, r, g -> Pair(r, g) }
.subscribeOn(Schedulers.io())
.flatMapSingle { (r, g) -> repository.getIdentityRecords(r, g.orNull()) }
.throttleLatest(250, TimeUnit.MILLISECONDS, true)
.switchMapSingle { (r, g) -> repository.getIdentityRecords(r, g.orNull()) }
.subscribeBy { newState ->
identityRecordsStore.update { newState }
}