summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-10-20 07:54:34 +0200
committerErik Larkö <erik@mullvad.net>2017-10-20 09:55:10 +0200
commit3dcf576b4b8591bed65e9335b8e6dae8c0f18456 (patch)
treef56e26e77863963fd5824f6648442d0afec5c613 /app/lib
parent610343f0ae029aa810e6e6bcedc8a69226397eb2 (diff)
downloadmullvadvpn-3dcf576b4b8591bed65e9335b8e6dae8c0f18456.tar.xz
mullvadvpn-3dcf576b4b8591bed65e9335b8e6dae8c0f18456.zip
Shutdown instead of disconnecting the backend on exit
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js7
-rw-r--r--app/lib/ipc-facade.js6
2 files changed, 13 insertions, 0 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index b7f3f3e489..b210e65e85 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -299,6 +299,13 @@ export class Backend {
});
}
+ shutdown(): Promise<void> {
+ return this._ensureAuthenticated()
+ .then( () => {
+ return this._ipc.shutdown();
+ });
+ }
+
/**
* Start reachability monitoring for online/offline detection
* This is currently done via HTML5 APIs but will be replaced later
diff --git a/app/lib/ipc-facade.js b/app/lib/ipc-facade.js
index c2938ae8f1..8939e82823 100644
--- a/app/lib/ipc-facade.js
+++ b/app/lib/ipc-facade.js
@@ -40,6 +40,7 @@ export interface IpcFacade {
setCustomRelay(RelayEndpoint): Promise<void>,
connect(): Promise<void>,
disconnect(): Promise<void>,
+ shutdown(): Promise<void>,
getIp(): Promise<Ip>,
getLocation(): Promise<Location>,
getState(): Promise<BackendState>,
@@ -109,6 +110,11 @@ export class RealIpc implements IpcFacade {
.then(this._ignoreResponse);
}
+ shutdown(): Promise<void> {
+ return this._ipc.send('shutdown')
+ .then(this._ignoreResponse);
+ }
+
getIp(): Promise<Ip> {
return this._ipc.send('get_ip')
.then(raw => {