diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-07-06 12:48:52 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-07-07 10:13:17 +0200 |
| commit | 00a09cd164be3d2a24cd4634b594c278c8c24da9 (patch) | |
| tree | 10e62d195603fb8cc940fad2068475d4c1009ec6 /app/lib/ipc-facade.js | |
| parent | 35f2a91585f4c94de2e4668eab99890fa50c22a9 (diff) | |
| download | mullvadvpn-00a09cd164be3d2a24cd4634b594c278c8c24da9.tar.xz mullvadvpn-00a09cd164be3d2a24cd4634b594c278c8c24da9.zip | |
The Backend class is no longer an EventEmitter
Diffstat (limited to 'app/lib/ipc-facade.js')
| -rw-r--r-- | app/lib/ipc-facade.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js index 19daf71b97..ff2b7050ed 100644 --- a/app/lib/ipc-facade.js +++ b/app/lib/ipc-facade.js @@ -1,14 +1,16 @@ // @flow import JsonRpcWs, { InvalidReply } from './jsonrpc-ws-ipc'; -import { object, string, number, arrayOf } from 'validated/schema'; +import { object, string, arrayOf, number } from 'validated/schema'; import { validate } from 'validated/object'; +import type { Coordinate2d } from '../types'; + export type AccountData = {paid_until: string}; export type AccountNumber = string; export type Ip = string; export type Location = { - latlong: Array<number>, + latlong: Coordinate2d, country: string, city: string, }; @@ -90,7 +92,8 @@ export class RealIpc implements IpcFacade { return this._ipc.send('get_location') .then(raw => { try { - return validate(LocationSchema, raw); + const validated: any = validate(LocationSchema, raw); + return (validated: Location); } catch (e) { throw new InvalidReply(raw, e); } |
