diff --git a/frontend/src/components/dir-view/dir-view.js b/frontend/src/components/dir-view/dir-view.js
index bb1c68aa57..a8bfebdd40 100644
--- a/frontend/src/components/dir-view/dir-view.js
+++ b/frontend/src/components/dir-view/dir-view.js
@@ -108,10 +108,9 @@ class DirView extends React.Component {
});
}
- let repoName = repoInfo.repo_name;
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
+ let path = location.slice(location.indexOf(repoID) + repoID.length + 1); // get the string after repoID
+ path = path.slice(path.indexOf('/')); // get current path
this.setState({path: path});
if (!res.data.lib_need_decrypt) {
this.updateDirentList(path);
diff --git a/frontend/src/pages/wiki/side-panel.js b/frontend/src/pages/wiki/side-panel.js
index f03fb35489..2055ba9514 100644
--- a/frontend/src/pages/wiki/side-panel.js
+++ b/frontend/src/pages/wiki/side-panel.js
@@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
-import { gettext, siteRoot, repoID, slug } from '../../utils/constants';
+import { gettext, siteRoot, repoID, slug, username, permission } from '../../utils/constants';
import Logo from '../../components/logo';
import Loading from '../../components/loading';
import TreeView from '../../components/tree-view/tree-view';
@@ -73,7 +73,7 @@ class SidePanel extends Component {
{this.props.isTreeDataLoading &&