diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-10-11 12:42:35 +0200 |
|---|---|---|
| committer | Erik Larkö <erik@mullvad.net> | 2017-10-12 16:13:19 +0200 |
| commit | f4475573922f593c2f423ecf2d40bfd9099cc409 (patch) | |
| tree | 3d6dccc40c36790557f1a158afb7e29ba6aa48a7 | |
| parent | 49ec0b0687cfa4f1a0fbec72eac5600156b23692 (diff) | |
| download | mullvadvpn-f4475573922f593c2f423ecf2d40bfd9099cc409.tar.xz mullvadvpn-f4475573922f593c2f423ecf2d40bfd9099cc409.zip | |
Sync with backend upon authentication
| -rw-r--r-- | app/app.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/app.js b/app/app.js index 8421735dee..452e940a2b 100644 --- a/app/app.js +++ b/app/app.js @@ -28,14 +28,16 @@ ipcRenderer.on('backend-info', (_event, args) => { const credentials: IpcCredentials = args.credentials; backend.setLocation(credentials.connectionString); - backend.authenticate(credentials.sharedSecret); - backend.sync(); - backend.autologin() - .catch( e => { - if (e.type === 'NO_ACCOUNT') { - log.debug('No user set in the backend, showing window'); - ipcRenderer.send('show-window'); - } + backend.authenticate(credentials.sharedSecret) + .then(() => { + backend.sync(); + backend.autologin() + .catch( e => { + if (e.type === 'NO_ACCOUNT') { + log.debug('No user set in the backend, showing window'); + ipcRenderer.send('show-window'); + } + }); }); }); ipcRenderer.on('disconnect', () => { |
