1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 06:34:40 +00:00

Merge pull request #6518 from haiwen/fix-selected-file-metadata

fix: selected file metadata info
This commit is contained in:
杨国璇
2024-08-08 20:18:36 +08:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@@ -126,7 +126,7 @@ class DirentDetails extends React.Component {
repoInfo={this.props.currentRepoInfo}
dirent={dirent}
direntDetail={direntDetail}
path={path}
path={this.props.dirent ? path + '/' + dirent.name : path}
collaborators={collaborators}
collaboratorsCache={collaboratorsCache}
updateCollaboratorsCache={this.updateCollaboratorsCache}

View File

@@ -128,12 +128,14 @@ class LibContentContainer extends React.Component {
};
onDirentClick = (dirent, event) => {
this.setState({ currentDirent: dirent });
const isActive = dirent.isSelected;
this.setState({ currentDirent: isActive ? null : dirent });
this.props.onDirentClick(dirent, event);
};
onItemSelected = (dirent) => {
this.setState({ currentDirent: dirent });
const isActive = dirent.isSelected;
this.setState({ currentDirent: isActive ? null : dirent });
this.props.onItemSelected(dirent);
};
@@ -167,7 +169,7 @@ class LibContentContainer extends React.Component {
};
render() {
let { path, repoID, usedRepoTags } = this.props;
const { path, repoID, usedRepoTags } = this.props;
let isRepoInfoBarShow = false;
if (path === '/') {
if (usedRepoTags.length !== 0) {