File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,12 @@ class Nav extends React.PureComponent {
129
129
}
130
130
131
131
handleAddFile ( ) {
132
- this . props . newFile ( ) ;
132
+ this . props . newFile ( this . props . rootFile . id ) ;
133
133
this . setDropdown ( 'none' ) ;
134
134
}
135
135
136
136
handleAddFolder ( ) {
137
- this . props . newFolder ( ) ;
137
+ this . props . newFolder ( this . props . rootFile . id ) ;
138
138
this . setDropdown ( 'none' ) ;
139
139
}
140
140
@@ -662,7 +662,8 @@ Nav.propTypes = {
662
662
stopSketch : PropTypes . func . isRequired ,
663
663
setAllAccessibleOutput : PropTypes . func . isRequired ,
664
664
newFile : PropTypes . func . isRequired ,
665
- newFolder : PropTypes . func . isRequired
665
+ newFolder : PropTypes . func . isRequired ,
666
+ rootFile : PropTypes . func . isRequired
666
667
} ;
667
668
668
669
Nav . defaultProps = {
@@ -677,7 +678,8 @@ function mapStateToProps(state) {
677
678
return {
678
679
project : state . project ,
679
680
user : state . user ,
680
- unsavedChanges : state . ide . unsavedChanges
681
+ unsavedChanges : state . ide . unsavedChanges ,
682
+ rootFile : state . files . filter ( file => file . name === 'root' ) [ 0 ]
681
683
} ;
682
684
}
683
685
You can’t perform that action at this time.
0 commit comments