summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-03-19 10:08:51 +0000
committerEmīls Piņķis <emils@mullvad.net>2019-03-19 10:08:51 +0000
commit797ea73225b783ce61b381ce17fcd121c78a54b7 (patch)
tree5eefd3df30a3944490498ee789bbcaf692cff7ee
parent8af1d42799f2be079c68aec90c6328287fbb74e3 (diff)
downloadmullvadvpn-797ea73225b783ce61b381ce17fcd121c78a54b7.tar.xz
mullvadvpn-797ea73225b783ce61b381ce17fcd121c78a54b7.zip
Improve alphabetical sorting in GUI
-rw-r--r--gui/src/renderer/app.tsx12
1 files changed, 2 insertions, 10 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index 3d2c79230d..7d2cd2a69a 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -543,14 +543,6 @@ export default class AppRenderer {
}
private setRelays(relayList: IRelayList) {
- const compareStrings = (strA: string, strB: string) => {
- if (strA > strB) {
- return 1;
- } else if (strA < strB) {
- return -1;
- }
- return 0;
- };
const locations = relayList.countries
.map((country) => ({
name: country.name,
@@ -565,9 +557,9 @@ export default class AppRenderer {
hasActiveRelays: city.relays.length > 0,
relays: city.relays,
}))
- .sort((cityA, cityB) => compareStrings(cityA.name, cityB.name)),
+ .sort((cityA, cityB) => cityA.name.localeCompare(cityB.name)),
}))
- .sort((countryA, countryB) => compareStrings(countryA.name, countryB.name));
+ .sort((countryA, countryB) => countryA.name.localeCompare(countryB.name));
this.reduxActions.settings.updateRelayLocations(locations);
}