fetch all drafts at once for better performance
This commit is contained in:
parent
dbab7f20d0
commit
29c0666243
2 changed files with 35 additions and 20 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue