This commit is contained in:
Cassie Tarakajian 2019-10-08 16:36:38 -04:00
parent 3360c7c799
commit 53241c9180

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]
}; };
} }