summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-11-30 13:55:41 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-12-06 12:38:19 +0100
commitea7678ee52a4c0d950903383bdec67c4780d235e (patch)
tree91d2b838057dfbd87ab9f407f3f49268a514ff34 /app
parent7f20580a18bfde633a5d2cc5d7ed5210d414a9c1 (diff)
downloadmullvadvpn-ea7678ee52a4c0d950903383bdec67c4780d235e.tar.xz
mullvadvpn-ea7678ee52a4c0d950903383bdec67c4780d235e.zip
Enable flow for AccountPage
Diffstat (limited to 'app')
-rw-r--r--app/containers/AccountPage.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/app/containers/AccountPage.js b/app/containers/AccountPage.js
index 1727c1e5be..f5d31e5bc0 100644
--- a/app/containers/AccountPage.js
+++ b/app/containers/AccountPage.js
@@ -1,3 +1,5 @@
+// @flow
+
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
@@ -6,15 +8,20 @@ import accountActions from '../redux/account/actions';
import { shell } from 'electron';
import { links } from '../config';
-const mapStateToProps = (state) => {
- return state;
-};
+import type { ReduxState, ReduxDispatch } from '../redux/store';
+import type { SharedRouteProps } from '../routes';
-const mapDispatchToProps = (dispatch, props) => {
+const mapStateToProps = (state: ReduxState) => state;
+const mapDispatchToProps = (dispatch: ReduxDispatch, props: SharedRouteProps) => {
+ const { push: pushHistory } = bindActionCreators({ push }, dispatch);
const { logout } = bindActionCreators(accountActions, dispatch);
return {
- onLogout: () => logout(props.backend),
- onClose: () => dispatch(push('/settings')),
+ onLogout: () => {
+ logout(props.backend);
+ },
+ onClose: () => {
+ pushHistory('/settings');
+ },
onBuyMore: () => shell.openExternal(links['purchase'])
};
};