mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-26 23:34:45 +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) => {
|
addDirent = (name, type, size) => {
|
||||||
let direntList = this.state.direntList;
|
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)) {
|
if (direntList.some(item => item.name === name)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user