mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 15:26:19 +00:00
Add comment in add file callback funtion (#8170)
This commit is contained in:
@@ -1740,6 +1740,8 @@ class LibContentView extends React.Component {
|
||||
|
||||
addDirent = (name, type, size) => {
|
||||
let direntList = this.state.direntList;
|
||||
// The notification server may have received the 'repo-update' message and setState the direntList.
|
||||
// So this file may already be in the direntList, we check if it has a duplicate name to avoid inserting new file repeatedly.
|
||||
if (direntList.some(item => item.name === name)) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user