Merge pull request #1183 from processing/bug/add-file

fixes #1180
This commit is contained in:
Cassie Tarakajian 2019-10-08 16:40:37 -04:00 committed by GitHub
commit 560659e76a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,12 +129,12 @@ class Nav extends React.PureComponent {
}
handleAddFile() {
this.props.newFile();
this.props.newFile(this.props.rootFile.id);
this.setDropdown('none');
}
handleAddFolder() {
this.props.newFolder();
this.props.newFolder(this.props.rootFile.id);
this.setDropdown('none');
}
@ -662,7 +662,8 @@ Nav.propTypes = {
stopSketch: PropTypes.func.isRequired,
setAllAccessibleOutput: PropTypes.func.isRequired,
newFile: PropTypes.func.isRequired,
newFolder: PropTypes.func.isRequired
newFolder: PropTypes.func.isRequired,
rootFile: PropTypes.func.isRequired
};
Nav.defaultProps = {
@ -677,7 +678,8 @@ function mapStateToProps(state) {
return {
project: state.project,
user: state.user,
unsavedChanges: state.ide.unsavedChanges
unsavedChanges: state.ide.unsavedChanges,
rootFile: state.files.filter(file => file.name === 'root')[0]
};
}