avoid adding the same contact multiple times
This commit is contained in:
parent
e7340d80ea
commit
775c4da791
|
@ -72,10 +72,15 @@ class NewMessageActivity : SimpleActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addSelectedContact(contact: Contact) {
|
private fun addSelectedContact(contact: Contact) {
|
||||||
|
new_message_to.setText("")
|
||||||
|
if (selectedContacts.map { it.contactId }.contains(contact.contactId)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
selectedContacts.add(contact)
|
selectedContacts.add(contact)
|
||||||
|
|
||||||
selected_contacts.beVisible()
|
selected_contacts.beVisible()
|
||||||
message_divider_one.beVisible()
|
message_divider_one.beVisible()
|
||||||
new_message_to.setText("")
|
|
||||||
|
|
||||||
val views = ArrayList<View>()
|
val views = ArrayList<View>()
|
||||||
selectedContacts.forEach {
|
selectedContacts.forEach {
|
||||||
|
|
Loading…
Reference in New Issue