From ee39aa6c1a55b18b2a36a9a9eb8ba31c765fa6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B0=B8=E5=BC=BA?= <11704063+s-yongqiang@user.noreply.gitee.com> Date: Wed, 9 Apr 2025 14:10:48 +0800 Subject: [PATCH] Update lib-content-view.js --- frontend/src/pages/lib-content-view/lib-content-view.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 2be66b954a..0f4f3feaa3 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -171,15 +171,11 @@ class LibContentView extends React.Component { * } */ if (noticeData.type === 'file-lock-changed') { - const getStandardizedPath = (path) => { - return path.replace(/^\/+/, ''); - }; - const getNotificationPath = (noticeData) => { if (!noticeData.content || !noticeData.content.path) { return ''; } - const path = getStandardizedPath(noticeData.content.path); + const path = noticeData.content.path.replace(/^\/+/, ''); const lastSlashIndex = path.lastIndexOf('/'); return lastSlashIndex === -1 ? '' : path.slice(0, lastSlashIndex); }; @@ -188,7 +184,7 @@ class LibContentView extends React.Component { dirPath = dirPath.slice(1); const noticePath = getNotificationPath(noticeData); - if (dirPath === noticePath) { + if (dirPath === noticePath) { // Check if the notification path is the same as the current path const dirent = { name: noticeData.content.path.split('/').pop() }; if (noticeData.content.change_event === 'locked') { if (noticeData.content.expire === -1) {