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

fix: metadata set root (#7293)

* fix: metadata set root

* feat: update code

* feat: optimize code

* feat: optimize code

---------

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2025-01-02 16:04:46 +08:00
committed by GitHub
parent e34b0768ba
commit d263e1018f
3 changed files with 15 additions and 13 deletions

View File

@@ -523,13 +523,16 @@ class LibContentView extends React.Component {
window.history.pushState({ url: url, path: '' }, '', url);
};
hideMetadataView = () => {
hideMetadataView = (isSetRoot = false) => {
const { repoID } = this.props;
this.setState({
currentMode: LIST_MODE,
path: '',
currentMode: cookie.load('seafile_view_mode') || LIST_MODE,
path: isSetRoot ? '/' : this.getPathFromLocation(repoID),
viewId: '',
isDirentDetailShow: false
tagId: '',
currentDirent: isSetRoot ? null : this.state.currentDirent,
}, () => {
if (!isSetRoot) return;
this.showDir('/');
});
};
@@ -2216,7 +2219,7 @@ class LibContentView extends React.Component {
return (
<MetadataStatusProvider repoID={repoID} repoInfo={currentRepoInfo} hideMetadataView={this.hideMetadataView}>
<TagsProvider repoID={repoID} currentPath={path} repoInfo={currentRepoInfo} selectTagsView={this.onTreeNodeClick}>
<MetadataProvider repoID={repoID} currentPath={path} repoInfo={currentRepoInfo} selectMetadataView={this.onTreeNodeClick} hideMetadataView={this.hideMetadataView} >
<MetadataProvider repoID={repoID} currentPath={path} repoInfo={currentRepoInfo} selectMetadataView={this.onTreeNodeClick} >
<CollaboratorsProvider repoID={repoID}>
<div className="main-panel-center flex-row">
<div className="cur-view-container">