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
1 changed files with 6 additions and 4 deletions

View File

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