1
0
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:
Michael An
2025-08-27 13:28:08 +08:00
committed by GitHub
parent 6f9c66b64e
commit 2139d97478

View File

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