fetch all drafts at once for better performance

This commit is contained in:
tibbi 2021-10-18 19:22:06 +02:00
parent dbab7f20d0
commit 29c0666243
2 changed files with 35 additions and 20 deletions

View file

@ -266,11 +266,8 @@ class ConversationsAdapter(
private fun fetchDrafts(drafts: HashMap<Long, String?>) {
drafts.clear()
conversations.forEach { conversation ->
val draft = activity.getSmsDraft(conversation.threadId)
if (draft != null) {
drafts[conversation.threadId] = draft
}
for ((threadId, draft) in activity.getAllDrafts()) {
drafts[threadId] = draft
}
}