From 082ae4f30a05ab28dece5cf1d837b53f196f130b Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 26 Sep 2017 16:52:34 -0700 Subject: [PATCH] Fix dragging in files. --- js/components/MainWindow/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/components/MainWindow/index.js b/js/components/MainWindow/index.js index 333ff49c..3f8c6c45 100644 --- a/js/components/MainWindow/index.js +++ b/js/components/MainWindow/index.js @@ -52,7 +52,7 @@ export class MainWindow extends React.Component { this.supress(e); const { files } = e.dataTransfer; // TODO: Move this to an actionCreator - this.props.dispatch(loadFileFromReference(files[0])); + this.props.loadFileFromReference(files[0]); } render() { @@ -145,9 +145,8 @@ const mapStateToProps = state => { return { status, loading, doubled, shade, llama, working, focused }; }; -const mapDispatchToProps = dispatch => ({ - setFocus: () => { - dispatch({ type: SET_FOCUSED_WINDOW, window: WINDOWS.MAIN }); - } -}); +const mapDispatchToProps = { + setFocus: () => ({ type: SET_FOCUSED_WINDOW, window: WINDOWS.MAIN }), + loadFileFromReference +}; export default connect(mapStateToProps, mapDispatchToProps)(MainWindow);