1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

repair null repo create md bug (#2917)

This commit is contained in:
杨顺强
2019-01-31 11:32:10 +08:00
committed by Daniel Pan
parent 846479ac5b
commit ca2db5d005

View File

@@ -179,6 +179,14 @@ class DirentListView extends React.Component {
});
}
checkDuplicatedName = (newName) => {
let direntList = this.props.direntList;
let isDuplicated = direntList.some(object => {
return object.name === newName;
});
return isDuplicated;
}
render() {
const { direntList, sortBy, sortOrder } = this.props;
@@ -199,6 +207,7 @@ class DirentListView extends React.Component {
parentPath={this.props.path}
fileType={this.state.fileType}
onAddFile={this.onAddFile}
checkDuplicatedName={this.checkDuplicatedName}
addFileCancel={this.onCreateFileToggle}
/>
</ModalPortal>