diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/containers/AccountPage.js | 19 |
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']) }; }; |
