Skip to content

Commit

Permalink
do not suggest unpaired contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
migulyaev committed Sep 15, 2023
1 parent 614a042 commit 32e716c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import tech.relaycorp.letro.account.storage.AccountRepository
import tech.relaycorp.letro.contacts.model.Contact
import tech.relaycorp.letro.contacts.model.ContactPairingStatus
import tech.relaycorp.letro.contacts.storage.ContactsRepository
import tech.relaycorp.letro.utils.ext.isEmptyOrBlank
import tech.relaycorp.letro.utils.ext.isNotEmptyOrBlank
Expand Down Expand Up @@ -135,7 +136,11 @@ class CreateNewMessageViewModel @Inject constructor(
viewModelScope.launch {
contactsRepository.getContacts(ownerVeraId).collect {
contacts.clear()
contacts.addAll(it.sortedBy { it.alias?.lowercase() ?: it.contactVeraId.lowercase() })
contacts.addAll(
it
.filter { it.status == ContactPairingStatus.COMPLETED }
.sortedBy { it.alias?.lowercase() ?: it.contactVeraId.lowercase() },
)
}
}
}
Expand Down

0 comments on commit 32e716c

Please sign in to comment.