diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-21 14:12:39 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-02-21 14:12:39 +0000 |
| commit | 0fd89cfc1c91d90ec625199ba0460bb5fb8c9ec6 (patch) | |
| tree | 04b2f15f7f9aef83aa749b29757458486a11fee6 /app/components/SelectLocation.js | |
| parent | 191d72546accf308696f57ee14d27c1b221ad4b9 (diff) | |
| download | mullvadvpn-0fd89cfc1c91d90ec625199ba0460bb5fb8c9ec6.tar.xz mullvadvpn-0fd89cfc1c91d90ec625199ba0460bb5fb8c9ec6.zip | |
State management via Backend events
Diffstat (limited to 'app/components/SelectLocation.js')
| -rw-r--r-- | app/components/SelectLocation.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js index 702eea074b..41ef55fd33 100644 --- a/app/components/SelectLocation.js +++ b/app/components/SelectLocation.js @@ -33,7 +33,7 @@ export default class SelectLocation extends Component { return key === this.props.settings.preferredServer; } - drawCell(name, icon, onClick) { + drawCell(key, name, icon, onClick) { const classes = ['select-location__cell']; const selected = this.isSelected(name); @@ -44,7 +44,7 @@ export default class SelectLocation extends Component { const cellClass = classes.join(' '); return ( - <div key={ name } className={ cellClass } onClick={ onClick }> + <div key={ key } className={ cellClass } onClick={ onClick }> <If condition={ !!icon }> <Then> @@ -81,12 +81,12 @@ export default class SelectLocation extends Component { <CustomScrollbars autoHide={ true }> <div> - { this.drawCell('Fastest', './assets/images/icon-fastest.svg', ::this.handleFastest) } - { this.drawCell('Nearest', './assets/images/icon-nearest.svg', ::this.handleNearest) } + { this.drawCell('fastest', 'Fastest', './assets/images/icon-fastest.svg', ::this.handleFastest) } + { this.drawCell('nearest', 'Nearest', './assets/images/icon-nearest.svg', ::this.handleNearest) } <div className="select-location__separator"></div> - { servers.map((name) => this.drawCell(name, null, this.handleSelection.bind(this, name))) } + { Object.keys(servers).map((key) => this.drawCell(key, servers[key].name, null, this.handleSelection.bind(this, key))) } </div> </CustomScrollbars> |
