summaryrefslogtreecommitdiffhomepage
path: root/app/app.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-08-03 15:36:03 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-08-08 16:25:34 +0200
commit9f01cc07d2d6da86d43a002e52a189f60b63eb5d (patch)
tree8f5f13a221aefba51d485b7e6e77d5228269cca3 /app/app.js
parent7cb837912df646992f63ad5ff61c26871f5c24b8 (diff)
downloadmullvadvpn-9f01cc07d2d6da86d43a002e52a189f60b63eb5d.tar.xz
mullvadvpn-9f01cc07d2d6da86d43a002e52a189f60b63eb5d.zip
Add launch screen
Diffstat (limited to 'app/app.js')
-rw-r--r--app/app.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/app.js b/app/app.js
index 6a465e0867..4ccf992b03 100644
--- a/app/app.js
+++ b/app/app.js
@@ -137,7 +137,7 @@ export default class AppRenderer {
// Redirect the user after some time to allow for
// the 'Login Successful' screen to be visible
setTimeout(async () => {
- if (history.location.pathname === '/') {
+ if (history.location.pathname === '/login') {
actions.history.replace('/connect');
}
@@ -168,15 +168,19 @@ export default class AppRenderer {
actions.account.updateAccountToken(accountToken);
actions.account.loginSuccessful();
+ // take user to main view if user is still at launch screen `/`
if (history.location.pathname === '/') {
actions.history.replace('/connect');
}
} else {
log.debug('No account set, showing login view.');
+
+ // show window when account is not set
ipcRenderer.send('show-window');
- if (history.location.pathname !== '/') {
- actions.history.replace('/');
+ // take user to `/login` screen if user is at launch screen `/`
+ if (history.location.pathname === '/') {
+ actions.history.replace('/login');
}
}
}
@@ -191,7 +195,7 @@ export default class AppRenderer {
this._fetchAccountHistory(),
]);
actions.account.loggedOut();
- actions.history.replace('/');
+ actions.history.replace('/login');
} catch (e) {
log.info('Failed to logout: ', e.message);
}
@@ -385,6 +389,7 @@ export default class AppRenderer {
// save to redux that the app connected to daemon
this._reduxActions.daemon.connected();
+ // reset the reconnect backoff when connection established.
this._reconnectBackoff.reset();
// authenticate once connected
@@ -452,6 +457,9 @@ export default class AppRenderer {
this._reconnectBackoff.attempt(() => {
recover();
});
+
+ // take user back to the launch screen `/`.
+ actions.history.replace('/');
}
}