From 2139d97478fb3758b66d7feff0a83425b6664a66 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Wed, 27 Aug 2025 13:28:08 +0800 Subject: [PATCH] Add comment in add file callback funtion (#8170) --- frontend/src/pages/lib-content-view/lib-content-view.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index db6ec1d079..07d9263de1 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -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; }