Avoids duplicating urls in relay list add.

This commit is contained in:
Vitor Pamplona
2023-01-23 14:11:13 -03:00
parent a47aaab83c
commit 8d3d543318

View File

@@ -65,6 +65,8 @@ class NewRelayListViewModel: ViewModel() {
} }
fun addRelay(relay: Relay) { fun addRelay(relay: Relay) {
if (relays.value.filter { it.url == relay.url }.isNotEmpty()) return
_relays.update { _relays.update {
it.plus(relay) it.plus(relay)
} }