summaryrefslogtreecommitdiffhomepage
path: root/app/lib/backend.js
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-01-16 10:31:37 +0100
committerLinus Färnstrand <linus@mullvad.net>2018-01-16 10:31:37 +0100
commita595255a67749dc343a03ebee69a184f74692860 (patch)
tree98d1232fa1902b85fc134f289c1b890d4921a166 /app/lib/backend.js
parentc3933d569efe1196b9814abffe3ea7f00491df02 (diff)
parent7b3b291236b88a9c0855b93beb46eba1b2bd70d1 (diff)
downloadmullvadvpn-a595255a67749dc343a03ebee69a184f74692860.tar.xz
mullvadvpn-a595255a67749dc343a03ebee69a184f74692860.zip
Merge branch 'get-position'
Diffstat (limited to 'app/lib/backend.js')
-rw-r--r--app/lib/backend.js26
1 files changed, 6 insertions, 20 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index cd14adb045..9439e09256 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -128,12 +128,6 @@ export class Backend {
}
try {
- await this._fetchPublicIP();
- } catch(e) {
- log.error('Failed to fetch the public IP: ', e.message);
- }
-
- try {
await this._fetchLocation();
} catch(e) {
log.error('Failed to fetch the location: ', e.message);
@@ -359,7 +353,8 @@ export class Backend {
cities: country.cities.map((city) => ({
name: city.name,
code: city.code,
- position: city.position,
+ latitude: city.latitude,
+ longitude: city.longitude,
hasActiveRelays: city.has_active_relays,
}))
}));
@@ -369,18 +364,6 @@ export class Backend {
);
}
- async _fetchPublicIP() {
- await this._ensureAuthenticated();
-
- const publicIp = await this._ipc.getPublicIp();
-
- log.info('Got public IP: ', publicIp);
-
- this._store.dispatch(
- connectionActions.newPublicIp(publicIp)
- );
- }
-
async _fetchLocation() {
await this._ensureAuthenticated();
@@ -389,9 +372,12 @@ export class Backend {
log.info('Got location: ', location);
const locationUpdate = {
+ ip: location.ip,
country: location.country,
city: location.city,
- location: location.position
+ latitude: location.latitude,
+ longitude: location.longitude,
+ mullvadExitIp: location.mullvad_exit_ip,
};
this._store.dispatch(