Skip to content

Commit 9de3ebf

Browse files
committed
importing actions individually and restructure mapDispatchToProps
1 parent 81e46f9 commit 9de3ebf

File tree

2 files changed

+14
-31
lines changed

2 files changed

+14
-31
lines changed

client/modules/IDE/components/PreviewFrame.jsx

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ import { registerFrame } from '../../../utils/dispatcher';
2525

2626
import { getHTMLFile } from '../reducers/files';
2727

28-
import * as FileActions from '../actions/files';
29-
import * as IDEActions from '../actions/ide';
30-
import * as ProjectActions from '../actions/project';
31-
import * as EditorAccessibilityActions from '../actions/editorAccessibility';
32-
import * as PreferencesActions from '../actions/preferences';
33-
import * as UserActions from '../../User/actions';
34-
import * as ToastActions from '../actions/toast';
35-
import * as ConsoleActions from '../actions/console';
28+
import { stopSketch, expandConsole, endSketchRefresh } from '../actions/ide';
29+
import { setTextOutput, setGridOutput, setSoundOutput } from '../actions/preferences';
30+
import { setBlobUrl } from '../actions/files';
31+
import { clearConsole, dispatchConsoleEvent } from '../actions/console';
3632

3733

3834
const shouldRenderSketch = (props, prevProps = undefined) => {
@@ -381,31 +377,18 @@ const mapStateToProps = state => ({
381377
});
382378

383379

384-
/*
385-
setTextOutput={this.props.setTextOutput}
386-
setGridOutput={this.props.setGridOutput}
387-
setSoundOutput={this.props.setSoundOutput}
388-
dispatchConsoleEvent={this.props.dispatchConsoleEvent}
389-
endSketchRefresh={this.props.endSketchRefresh}
390-
stopSketch={this.props.stopSketch}
391-
setBlobUrl={this.props.setBlobUrl}
392-
expandConsole={this.props.expandConsole}
393-
clearConsole={this.props.clearConsole}
394-
cmController={this.cmController}
395-
*/
396-
397-
398380
const mapDispatchToProps = dispatch => bindActionCreators(
399381
Object.assign(
400382
{},
401-
EditorAccessibilityActions,
402-
FileActions,
403-
ProjectActions,
404-
IDEActions,
405-
PreferencesActions,
406-
UserActions,
407-
ToastActions,
408-
ConsoleActions
383+
stopSketch,
384+
expandConsole,
385+
endSketchRefresh,
386+
setTextOutput,
387+
setGridOutput,
388+
setSoundOutput,
389+
setBlobUrl,
390+
clearConsole,
391+
dispatchConsoleEvent,
409392
),
410393
dispatch
411394
);

client/modules/IDE/pages/IDEView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class IDEView extends React.Component {
363363
this.props.ide.isPlaying) ||
364364
this.props.ide.isAccessibleOutputPlaying}
365365
</div>
366-
<PreviewFrame />
366+
<PreviewFrame cmController={this.cmController} />
367367
</div>
368368
</section>
369369
</SplitPane>

0 commit comments

Comments
 (0)