We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be7e695 commit 4cf2c97Copy full SHA for 4cf2c97
app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt
@@ -252,11 +252,13 @@ class ThreadViewModel @Inject constructor(
252
253
val batch = input.take(batchSize)
254
output.addAll(batch)
255
- batchedMessages.postValue(output.toMutableList())
256
- if (batch.size < batchSize) return
257
258
- delay(50L)
+ // We need to post a different list each time, because the `submitList` function
+ // in AsyncListDiffer won't trigger if we send the same list object.
+ batchedMessages.postValue(ArrayList(output))
259
260
+ if (batch.size < batchSize) return
261
+ delay(50L)
262
sendBatchesRecursively(input.subList(batchSize, input.size), output)
263
}
264
0 commit comments