diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-30 13:56:34 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-12-06 12:38:19 +0100 |
| commit | 42474fc280f890eb248bf4ebc1726dee73249b33 (patch) | |
| tree | d9c4fc9232b290a845f22305d140706183f41c5b | |
| parent | d15b60581c94ef23ca4d29edfadbdfc7f436306e (diff) | |
| download | mullvadvpn-42474fc280f890eb248bf4ebc1726dee73249b33.tar.xz mullvadvpn-42474fc280f890eb248bf4ebc1726dee73249b33.zip | |
Enable flow for SettingsPage
| -rw-r--r-- | app/containers/SettingsPage.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/app/containers/SettingsPage.js b/app/containers/SettingsPage.js index 72eafb9431..dcd1d121bb 100644 --- a/app/containers/SettingsPage.js +++ b/app/containers/SettingsPage.js @@ -1,20 +1,24 @@ +// @flow + import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; import { push } from 'react-router-redux'; import Settings from '../components/Settings'; import { remote, 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); return { onQuit: () => remote.app.quit(), - onClose: () => dispatch(push('/connect')), - onViewAccount: () => dispatch(push('/settings/account')), - onViewSupport: () => dispatch(push('/settings/support')), - onViewAdvancedSettings: () => dispatch(push('/settings/advanced')), + onClose: () => pushHistory('/connect'), + onViewAccount: () => pushHistory('/settings/account'), + onViewSupport: () => pushHistory('/settings/support'), + onViewAdvancedSettings: () => pushHistory('/settings/advanced'), onExternalLink: (type) => shell.openExternal(links[type]), }; }; |
