@@ -5,14 +5,14 @@ import { bindActionCreators } from 'redux';
5
5
import { connect } from 'react-redux' ;
6
6
import PreviewFrame from '../components/PreviewFrame' ;
7
7
import PreviewNav from '../../../components/PreviewNav' ;
8
- import * as ProjectActions from '../actions/project' ;
8
+ import { getProject } from '../actions/project' ;
9
+ import { startSketch } from '../actions/ide' ;
9
10
10
11
class FullView extends React . Component {
11
12
componentDidMount ( ) {
12
- this . props . getProject (
13
- this . props . params . project_id ,
14
- this . props . params . username
15
- ) ;
13
+ this . props
14
+ . getProject ( this . props . params . project_id , this . props . params . username )
15
+ . then ( this . props . startSketch ) ;
16
16
}
17
17
18
18
render ( ) {
@@ -51,7 +51,8 @@ FullView.propTypes = {
51
51
username : PropTypes . string
52
52
} )
53
53
} ) . isRequired ,
54
- getProject : PropTypes . func . isRequired
54
+ getProject : PropTypes . func . isRequired ,
55
+ startSketch : PropTypes . func . isRequired
55
56
} ;
56
57
57
58
function mapStateToProps ( state ) {
@@ -61,7 +62,7 @@ function mapStateToProps(state) {
61
62
}
62
63
63
64
function mapDispatchToProps ( dispatch ) {
64
- return bindActionCreators ( ProjectActions , dispatch ) ;
65
+ return bindActionCreators ( { getProject , startSketch } , dispatch ) ;
65
66
}
66
67
67
68
export default connect ( mapStateToProps , mapDispatchToProps ) ( FullView ) ;
0 commit comments