1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

remove wrong logic about selected path (#6887)

* remove wrong logic about selected path

* change function name

---------

Co-authored-by: zhouwenxuan <aries@Mac.local>
Co-authored-by: Michael An <2331806369@qq.com>
This commit is contained in:
Aries
2024-10-14 09:57:11 +08:00
committed by GitHub
parent df29823634
commit 52cccb5ce9
2 changed files with 4 additions and 12 deletions

View File

@@ -42,7 +42,6 @@ class SelectDirentBody extends React.Component {
try {
const res = await seafileAPI.getRepoInfo(this.props.repoID);
const repoInfo = new RepoInfo(res.data);
this.props.setSelectedPath('/');
this.setState({
currentRepoInfo: repoInfo,
selectedRepo: repoInfo,
@@ -60,9 +59,6 @@ class SelectDirentBody extends React.Component {
const repoList = repos.filter((repo) => repo.permission === 'rw' && repo.repo_id !== this.props.repoID);
const sortedRepoList = Utils.sortRepos(repoList, 'name', 'asc');
const selectedRepo = sortedRepoList.find((repo) => repo.repo_id === this.props.repoID);
const path = this.props.path.substring(0, this.props.path.length - 1);
this.props.setSelectedPath(path);
this.setState({
repoList: sortedRepoList,
selectedRepo: selectedRepo || this.state.selectedRepo,
@@ -92,10 +88,6 @@ class SelectDirentBody extends React.Component {
});
};
selectPath = (path) => {
this.props.setSelectedPath(path);
};
setBrowsingPath = (path) => {
this.setState({ browsingPath: path });
};
@@ -158,7 +150,7 @@ class SelectDirentBody extends React.Component {
onDirentItemClick={this.onDirentItemClick}
selectSearchedItem={this.selectSearchedItem}
selectRepo={this.onSelectSearchedRepo}
selectPath={this.selectPath}
setSelectedPath={this.props.setSelectedPath}
setBrowsingPath={this.setBrowsingPath}
/>
)}