@@ -7,13 +7,16 @@ import MainContainer from './MainContainer.jsx';
7
7
import RightContainer from './RightContainer.jsx' ;
8
8
import convertIdToObjs from '../utils/convertIdsToObjs.util' ;
9
9
import theme from '../components/theme' ;
10
+ import { loadInitData } from '../actions/components' ;
10
11
11
12
const mapStateToProps = store => ( {
12
13
components : store . workspace . components ,
13
14
totalComponents : store . workspace . totalComponents ,
14
15
focusComponent : store . workspace . focusComponent ,
15
16
} ) ;
16
17
18
+ const mapDispatchToProps = { loadInitData } ;
19
+
17
20
class AppContainer extends Component {
18
21
state = {
19
22
width : 25 ,
@@ -34,6 +37,10 @@ class AppContainer extends Component {
34
37
}
35
38
}
36
39
40
+ componentDidMount ( ) {
41
+ this . props . loadInitData ( ) ;
42
+ }
43
+
37
44
render ( ) {
38
45
const { components, totalComponents, focusComponent } = this . props ;
39
46
const { width, rightColumnOpen } = this . state ;
@@ -66,10 +73,11 @@ class AppContainer extends Component {
66
73
}
67
74
}
68
75
69
- export default connect ( mapStateToProps ) ( AppContainer ) ;
76
+ export default connect ( mapStateToProps , mapDispatchToProps ) ( AppContainer ) ;
70
77
71
78
AppContainer . propTypes = {
72
79
components : PropTypes . array . isRequired ,
73
80
totalComponents : PropTypes . number . isRequired ,
74
81
focusComponent : PropTypes . object . isRequired ,
82
+ loadInitData : PropTypes . func . isRequired ,
75
83
} ;
0 commit comments