summaryrefslogtreecommitdiffhomepage
path: root/app/components
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-02-13 17:06:05 +0000
committerAndrej Mihajlov <and@codeispoetry.ru>2017-02-13 17:06:05 +0000
commit18f8c8bdfa2575242f41dd775b6a51a38f962e1e (patch)
treef007b6942fcf587534ac0f8d3b072f9045bcdb34 /app/components
parent91c10ffcf4c0577507970d71f1d21f4a7de51196 (diff)
downloadmullvadvpn-18f8c8bdfa2575242f41dd775b6a51a38f962e1e.tar.xz
mullvadvpn-18f8c8bdfa2575242f41dd775b6a51a38f962e1e.zip
Add logout
Diffstat (limited to 'app/components')
-rw-r--r--app/components/Tray.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/components/Tray.js b/app/components/Tray.js
index 11075cab36..00dc679981 100644
--- a/app/components/Tray.js
+++ b/app/components/Tray.js
@@ -2,15 +2,17 @@ import React, { Component, PropTypes } from 'react';
import { TrayMenu, TrayItem } from '../lib/components/TrayMenu';
import { shell } from 'electron';
+import { LoginState } from '../constants';
+
export default class Tray extends Component {
static propTypes = {
handle: PropTypes.object.isRequired,
+ backend: PropTypes.object.isRequired
}
logout() {
- this.props.login({ username: '', loggedIn: false });
- this.props.history.push('/');
+ this.props.logout(this.props.backend);
}
openPrivacyPolicy() {
@@ -22,7 +24,7 @@ export default class Tray extends Component {
}
render() {
- const loggedIn = this.props.user && this.props.user.loggedIn;
+ const loggedIn = this.props.user.status === LoginState.ok;
return (
<TrayMenu tray={ this.props.handle }>