diff options
| author | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-06 19:15:53 +0000 |
|---|---|---|
| committer | Andrej Mihajlov <and@codeispoetry.ru> | 2017-03-06 19:15:53 +0000 |
| commit | aac77666f5d2fc1dacad664dedbb44733550a3f9 (patch) | |
| tree | 6f97fccfeeb088ac274382ccf2a8570dc83eed45 /app/components | |
| parent | 731a9e48bb5cc21c0156b81fa1e027faee86ae0a (diff) | |
| download | mullvadvpn-aac77666f5d2fc1dacad664dedbb44733550a3f9.tar.xz mullvadvpn-aac77666f5d2fc1dacad664dedbb44733550a3f9.zip | |
Fetch user location from freegeoip.net
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Connect.css | 5 | ||||
| -rw-r--r-- | app/components/Connect.js | 12 |
2 files changed, 7 insertions, 10 deletions
diff --git a/app/components/Connect.css b/app/components/Connect.css index c74c0da03d..b28ba52674 100644 --- a/app/components/Connect.css +++ b/app/components/Connect.css @@ -23,7 +23,7 @@ .connect__footer { display: flex; flex-direction: column; - padding: 42px 24px 24px; + padding: 0px 24px 24px; } .connect__row + .connect__row{ @@ -88,7 +88,8 @@ .connect__status { padding: 0 24px; - margin-top: auto; + margin-top: 188px; + margin-bottom: 42px; } .connect__status-security { diff --git a/app/components/Connect.js b/app/components/Connect.js index 3b7dc70adf..307002970d 100644 --- a/app/components/Connect.js +++ b/app/components/Connect.js @@ -21,12 +21,7 @@ export default class Connect extends Component { super(); this.state = { - isFirstPass: true, - userLocation: { - location: [28.358744, -14.053676], - city: 'Corralejo', - country: 'Spain' - } + isFirstPass: true }; } @@ -53,7 +48,7 @@ export default class Connect extends Component { const displayLocation = this.displayLocation(); const bounds = this.getBounds(displayLocation.location, altitude); - const userLocation = this.toLngLat(this.state.userLocation.location); + const userLocation = this.toLngLat(this.props.user.location); const serverLocation = this.toLngLat(serverInfo.location); const mapBounds = this.toLngLatBounds(bounds); const mapBoundsOptions = { offset: [0, -113], animate: !this.state.isFirstPass }; @@ -263,7 +258,8 @@ export default class Connect extends Component { displayLocation() { if(this.props.connect.status === ConnectionState.disconnected) { - return this.state.userLocation; + const { location, country, city } = this.props.user; + return { location, country, city }; } const preferredServer = this.props.settings.preferredServer; |
