summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayList.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayList.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayList.kt
index 7d09e421db..781155df51 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayList.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/relaylist/RelayList.kt
@@ -7,7 +7,7 @@ class RelayList {
val countries: List<RelayCountry>
constructor(model: net.mullvad.mullvadvpn.model.RelayList) {
- countries = model.countries
+ var relayCountries = model.countries
.map { country ->
val cities = mutableListOf<RelayCity>()
val relayCountry = RelayCountry(country.name, country.code, false, cities)
@@ -21,15 +21,22 @@ class RelayList {
for (relay in validCityRelays) {
relays.add(Relay(relayCity, relay.hostname, relay.active))
}
+ relays.sortBy({ it.name })
if (relays.isNotEmpty()) {
cities.add(relayCity)
}
}
+ cities.sortBy({ it.name })
relayCountry
}
.filter { country -> country.cities.isNotEmpty() }
+ .toMutableList()
+
+ relayCountries.sortBy({ it.name })
+
+ countries = relayCountries.toList()
}
fun findItemForLocation(