mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 05:39:59 +00:00
repair goto repo bug
This commit is contained in:
@@ -11,8 +11,8 @@ import FileTag from '../../models/file-tag';
|
||||
import Repo from '../../models/repo';
|
||||
|
||||
const propTypes = {
|
||||
pathPrefix: PropTypes.object.isRequired,
|
||||
onMenuClick: PropTypes.func.isRequired,
|
||||
updateCurrentTab: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class DirView extends React.Component {
|
||||
@@ -53,15 +53,9 @@ class DirView extends React.Component {
|
||||
permission: repo.permission === 'rw',
|
||||
currentRepo: repo,
|
||||
});
|
||||
|
||||
let repoName = encodeURIComponent(repo.repo_name);
|
||||
let index = location.href.indexOf(repoName) + repoName.length;
|
||||
let path = decodeURIComponent(location.href.slice(index));
|
||||
this.setState({path: path});
|
||||
this.updateDirentList(path);
|
||||
});
|
||||
|
||||
this.props.updateCurrentTab('my-libs'); // just for refersh brower;
|
||||
this.updateDirentList(this.state.path);
|
||||
});
|
||||
}
|
||||
|
||||
updateDirentList = (filePath) => {
|
||||
@@ -430,6 +424,7 @@ class DirView extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<DirPanel
|
||||
pathPrefix={this.props.pathPrefix}
|
||||
currentRepo={this.state.currentRepo}
|
||||
path={this.state.path}
|
||||
pathExist={this.state.pathExit}
|
||||
|
Reference in New Issue
Block a user