From 1e52d9dc89b7ba165effcbfbc430a30528d2d8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=A1=BA=E5=BC=BA?= Date: Sat, 22 Dec 2018 16:30:54 +0800 Subject: [PATCH] repair bug (#2701) --- frontend/src/components/dir-view/dir-view.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/dir-view/dir-view.js b/frontend/src/components/dir-view/dir-view.js index 3593ee0ccb..4db6093545 100644 --- a/frontend/src/components/dir-view/dir-view.js +++ b/frontend/src/components/dir-view/dir-view.js @@ -64,8 +64,9 @@ class DirView extends React.Component { }); let repoName = repoInfo.repo_name; - let index = location.indexOf(repoName); - let path = location.slice(index + repoName.length); + let repoID = repoInfo.repo_id; + let path = location.slice(location.indexOf(repoID) + repoID.length); // get the string after repoID + path = path.slice(path.indexOf(repoName) + repoName.length); // get current path this.setState({path: path}); if (!res.data.lib_need_decrypt) { this.updateDirentList(path);