Added initial all sources selection if none selected previously

This commit is contained in:
merkost 2023-07-20 12:47:12 +10:00
parent 03d6662e5b
commit 5c8f39c626
1 changed files with 5 additions and 1 deletions

View File

@ -116,9 +116,13 @@ class ManageAutoBackupsDialog(private val activity: SimpleActivity, onSuccess: (
return
}
if (selectedContactSources.isEmpty()) {
selectedContactSources = contactSources.map { it.name }.toSet()
}
val contactSourcesWithCount = mutableListOf<ContactSource>()
for (source in contactSources) {
val count = contacts.filter { it.source == source.name }.count()
val count = contacts.count { it.source == source.name }
contactSourcesWithCount.add(source.copy(count = count))
}