@@ -10,6 +10,7 @@ import { bindActionCreators } from 'redux';
10
10
11
11
import * as IDEActions from '../actions/ide' ;
12
12
import * as ProjectActions from '../actions/project' ;
13
+ import * as ConsoleActions from '../actions/console' ;
13
14
14
15
// Local Imports
15
16
import Editor from '../components/Editor' ;
@@ -67,8 +68,8 @@ const getNatOptions = (username = undefined) =>
67
68
68
69
const MobileIDEView = ( props ) => {
69
70
const {
70
- ide, project, selectedFile, user, params, unsavedChanges,
71
- stopSketch, startSketch, getProject, clearPersistedState
71
+ ide, project, selectedFile, user, params, unsavedChanges, collapseConsole ,
72
+ stopSketch, startSketch, getProject, clearPersistedState,
72
73
} = props ;
73
74
74
75
const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
@@ -84,7 +85,10 @@ const MobileIDEView = (props) => {
84
85
85
86
// Force state reset
86
87
useEffect ( clearPersistedState , [ ] ) ;
87
- useEffect ( stopSketch , [ ] ) ;
88
+ useEffect ( ( ) => {
89
+ stopSketch ( ) ;
90
+ collapseConsole ( ) ;
91
+ } , [ ] ) ;
88
92
89
93
// Load Project
90
94
const [ currentProjectID , setCurrentProjectID ] = useState ( null ) ;
@@ -172,6 +176,7 @@ MobileIDEView.propTypes = {
172
176
stopSketch : PropTypes . func . isRequired ,
173
177
getProject : PropTypes . func . isRequired ,
174
178
clearPersistedState : PropTypes . func . isRequired ,
179
+ collapseConsole : PropTypes . func . isRequired ,
175
180
} ;
176
181
177
182
function mapStateToProps ( state ) {
@@ -192,7 +197,8 @@ function mapStateToProps(state) {
192
197
193
198
const mapDispatchToProps = dispatch => bindActionCreators ( {
194
199
...ProjectActions ,
195
- ...IDEActions
200
+ ...IDEActions ,
201
+ ...ConsoleActions
196
202
} , dispatch ) ;
197
203
198
204
export default withRouter ( connect ( mapStateToProps , mapDispatchToProps ) ( MobileIDEView ) ) ;
0 commit comments