diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2018-04-17 16:01:26 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2018-04-17 16:01:26 +0100 |
| commit | c4051935bce33d57d0708a4ed610279e67b58ce2 (patch) | |
| tree | 5ee6bb5e2bf9e7d03ff05f02efd266968e7e1460 /app | |
| parent | 0009eca64d31768b6eef1be787761b217cf0cdc8 (diff) | |
| parent | 06618e704849a42cf3dc522d9d30efac5c07d869 (diff) | |
| download | mullvadvpn-c4051935bce33d57d0708a4ed610279e67b58ce2.tar.xz mullvadvpn-c4051935bce33d57d0708a4ed610279e67b58ce2.zip | |
Merge branch 'linux-packaging'
Diffstat (limited to 'app')
| -rw-r--r-- | app/app.js | 8 | ||||
| -rw-r--r-- | app/main.js | 15 |
2 files changed, 19 insertions, 4 deletions
diff --git a/app/app.js b/app/app.js index 6e9272e88b..13a5c75f59 100644 --- a/app/app.js +++ b/app/app.js @@ -47,6 +47,14 @@ ipcRenderer.on('shutdown', () => { log.warn('Unable to shut down the backend', e.message); }); }); + +ipcRenderer.on('disconnect', () => { + log.info('Been told by the node process to disconnect the tunnel'); + backend.disconnect() + .catch( e => { + log.warn('Unable to disconnect the tunnel', e.message); + }); +}); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/app/main.js b/app/main.js index 6370292d72..0c5eb7ec73 100644 --- a/app/main.js +++ b/app/main.js @@ -95,10 +95,17 @@ const appDelegate = { ipcMain.on('hide-window', () => window.hide()); window.loadURL('file://' + path.join(__dirname, 'index.html')); - window.on('close', () => { - log.debug('The browser window is closing, shutting down the tunnel...'); - window.webContents.send('shutdown'); - }); + if (process.platform === 'linux') { + window.on('close', () => { + log.debug('The browser window is closing, shutting down the tunnel...'); + window.webContents.send('disconnect'); + }); + } else { + window.on('close', () => { + log.debug('The browser window is closing, shutting down the daemon...'); + window.webContents.send('shutdown'); + }); + } ipcMain.on('collect-logs', (event, id, toRedact) => { log.info('Collecting logs in', appDelegate._logFileLocation); |
