diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-30 12:12:36 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-12-06 11:48:39 +0100 |
| commit | de56ce638d953a2eaf7769ac86df58e5c5839a52 (patch) | |
| tree | 94f082406dcb4913c93fbaaf3bcc17d5750c009a /app/components | |
| parent | d518c38f81f033a45c87bb6cf314fb328bb2eacf (diff) | |
| download | mullvadvpn-de56ce638d953a2eaf7769ac86df58e5c5839a52.tar.xz mullvadvpn-de56ce638d953a2eaf7769ac86df58e5c5839a52.zip | |
Flatten server list
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/SelectLocation.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js index a416a768ea..e0f50a12d4 100644 --- a/app/components/SelectLocation.js +++ b/app/components/SelectLocation.js @@ -4,6 +4,7 @@ import { Layout, Container, Header } from './Layout'; import CustomScrollbars from './CustomScrollbars'; import { servers } from '../config'; +import type { ServerInfo } from '../lib/backend'; import type { SettingsReduxState } from '../redux/settings/reducers'; import type { RelayLocation } from '../lib/ipc-facade'; @@ -100,14 +101,14 @@ export default class SelectLocation extends Component { <div className="select-location__separator"></div> - { Object.keys(servers).map((key) => { - const { name, country_code, city_code } = servers[key]; - const location = { + { (servers: Array<ServerInfo>).map((server) => { + const { address, name, country_code, city_code } = server; + const relayLocation = { city: [ country_code, city_code ] }; - const selected = this._isSelected(location); - const clickHandler = () => this._onSelect(location); - return this.drawCell(key, name, selected, null, clickHandler); + const selected = this._isSelected(relayLocation); + const clickHandler = () => this._onSelect(relayLocation); + return this.drawCell(address, name, selected, null, clickHandler); }) } </div> |
