mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-28 17:02:26 +02:00
Avoids duplicating urls in relay list add.
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user