summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-05-28 00:33:47 +0200
committerErik Larkö <erik@mullvad.net>2017-05-28 18:17:45 +0200
commit60cdaa96ff099212d99457a9e2e69d7f3c827832 (patch)
tree3ab0a1b8b4118809c9d6e6f905a55f5e674ac326 /app
parent6daf4bb8d27251a298558f1823d5d198d7c0538e (diff)
downloadmullvadvpn-60cdaa96ff099212d99457a9e2e69d7f3c827832.tar.xz
mullvadvpn-60cdaa96ff099212d99457a9e2e69d7f3c827832.zip
Very slightly improve notification handling
Diffstat (limited to 'app')
-rw-r--r--app/lib/jsonrpc-ws-ipc.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/jsonrpc-ws-ipc.js b/app/lib/jsonrpc-ws-ipc.js
index f3850c430c..3d028c5a23 100644
--- a/app/lib/jsonrpc-ws-ipc.js
+++ b/app/lib/jsonrpc-ws-ipc.js
@@ -74,14 +74,14 @@ export default class Ipc {
this._sendTimeoutMillis = millis;
}
- on(event: string, listener: (any) => void) {
+ on(event: string, listener: (any) => void): Promise<*> {
// We're currently not actually using the event parameter.
// This is because we aren't sure if the backend will use
// one subscription per event or one subscription per
// event source.
log.info('Adding a listener to', event);
- this.send('event_subscribe')
+ return this.send('event_subscribe')
.then(subscriptionId => this._subscriptions[subscriptionId] = listener);
}