@@ -10,6 +10,7 @@ import { bindActionCreators } from 'redux';
1010
1111import * as IDEActions from '../actions/ide' ;
1212import * as ProjectActions from '../actions/project' ;
13+ import * as ConsoleActions from '../actions/console' ;
1314
1415// Local Imports
1516import Editor from '../components/Editor' ;
@@ -67,8 +68,8 @@ const getNatOptions = (username = undefined) =>
6768
6869const MobileIDEView = ( props ) => {
6970 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,
7273 } = props ;
7374
7475 const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
@@ -84,7 +85,10 @@ const MobileIDEView = (props) => {
8485
8586 // Force state reset
8687 useEffect ( clearPersistedState , [ ] ) ;
87- useEffect ( stopSketch , [ ] ) ;
88+ useEffect ( ( ) => {
89+ stopSketch ( ) ;
90+ collapseConsole ( ) ;
91+ } , [ ] ) ;
8892
8993 // Load Project
9094 const [ currentProjectID , setCurrentProjectID ] = useState ( null ) ;
@@ -172,6 +176,7 @@ MobileIDEView.propTypes = {
172176 stopSketch : PropTypes . func . isRequired ,
173177 getProject : PropTypes . func . isRequired ,
174178 clearPersistedState : PropTypes . func . isRequired ,
179+ collapseConsole : PropTypes . func . isRequired ,
175180} ;
176181
177182function mapStateToProps ( state ) {
@@ -192,7 +197,8 @@ function mapStateToProps(state) {
192197
193198const mapDispatchToProps = dispatch => bindActionCreators ( {
194199 ...ProjectActions ,
195- ...IDEActions
200+ ...IDEActions ,
201+ ...ConsoleActions
196202} , dispatch ) ;
197203
198204export default withRouter ( connect ( mapStateToProps , mapDispatchToProps ) ( MobileIDEView ) ) ;
0 commit comments