summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/containers/SettingsPage.js20
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]),
};
};