From e063f977e3529782e5b29fba0111717996237112 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Mon, 23 Sep 2024 15:18:17 +0200 Subject: [PATCH] review: Remove magic number --- .../java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt b/app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt index 3ebfe3d9d8..97a82361bf 100644 --- a/app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt +++ b/app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadViewModel.kt @@ -259,7 +259,7 @@ class ThreadViewModel @Inject constructor( batchedMessages.postValue(ArrayList(output)) if (batch.size < batchSize) return - delay(50L) + delay(DELAY_BETWEEN_EACH_BATCHED_MESSAGES) sendBatchesRecursively(input.subList(batchSize, input.size), output) } @@ -471,5 +471,6 @@ class ThreadViewModel @Inject constructor( companion object { private const val SUPER_COLLAPSED_BLOCK_MINIMUM_MESSAGES_LIMIT = 5 private const val SUPER_COLLAPSED_BLOCK_FIRST_INDEX_LIMIT = 3 + private const val DELAY_BETWEEN_EACH_BATCHED_MESSAGES = 50L } }