summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-12-13 15:33:20 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-12-19 14:12:42 +0100
commitb02baf60e26a2e5794dc145e72047b1005f0c2d3 (patch)
treeaf41ec8e77d214f0e832000b6d88c573c3ce1885 /app/lib
parente35c46c9e0d4fcd8b146be523550e2a88ff1aecf (diff)
downloadmullvadvpn-b02baf60e26a2e5794dc145e72047b1005f0c2d3.tar.xz
mullvadvpn-b02baf60e26a2e5794dc145e72047b1005f0c2d3.zip
Drop hardcoded servers in favor of relay locations
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js31
1 files changed, 1 insertions, 30 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index 6e79188043..3099a7f129 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -2,7 +2,6 @@
import log from 'electron-log';
import EventEmitter from 'events';
-import { servers } from '../config';
import { IpcFacade, RealIpc } from './ipc-facade';
import accountActions from '../redux/account/actions';
import connectionActions from '../redux/connection/actions';
@@ -10,21 +9,11 @@ import settingsActions from '../redux/settings/actions';
import { push } from 'react-router-redux';
import type { ReduxStore } from '../redux/store';
-import type { AccountToken, BackendState, RelayLocation, RelaySettingsUpdate } from './ipc-facade';
+import type { AccountToken, BackendState, RelaySettingsUpdate } from './ipc-facade';
import type { ConnectionState } from '../redux/connection/reducers';
export type ErrorType = 'NO_CREDIT' | 'NO_INTERNET' | 'INVALID_ACCOUNT' | 'NO_ACCOUNT';
-export type ServerInfo = {
- address: string,
- name: string,
- city: string,
- country: string,
- country_code: string,
- city_code: string,
- location: [number, number],
-};
-
export class BackendError extends Error {
type: ErrorType;
title: string;
@@ -179,24 +168,6 @@ export class Backend {
await this._updateAccountHistory();
}
- serverInfo(relay: RelayLocation): ?ServerInfo {
- const list: Array<ServerInfo> = servers;
- if(relay.country) {
- const country = relay.country;
- return list.find((server) => {
- return server.country_code === country;
- });
- } else if(relay.city) {
- const [country_code, city_code] = relay.city;
- return list.find((server) => {
- return server.country_code === country_code &&
- server.city_code === city_code;
- });
- } else {
- return null;
- }
- }
-
async login(accountToken: AccountToken): Promise<void> {
log.debug('Attempting to login');