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

fix search when change repoID (#6338)

* fix search when change repoID

* change function name
This commit is contained in:
Michael An
2024-07-11 20:37:57 +08:00
committed by GitHub
parent 1963e7538e
commit 10dfe2e47c
4 changed files with 60 additions and 29 deletions

View File

@@ -32,6 +32,7 @@ class CommonToolbar extends React.Component {
isLibView: props.isLibView,
path: props.path,
isViewFile: props.isViewFile,
currentRepoInfo: props.currentRepoInfo,
};
}
@@ -45,12 +46,12 @@ class CommonToolbar extends React.Component {
this.unsubscribeLibChange && this.unsubscribeLibChange();
}
onRepoChange = ({ repoID, repoName, isLibView, path, isViewFile }) => {
this.setState({ repoID, repoName, isLibView, path, isViewFile });
onRepoChange = ({ repoID, repoName, isLibView, path, isViewFile, currentRepoInfo }) => {
this.setState({ repoID, repoName, isLibView, path, isViewFile, currentRepoInfo });
};
renderSearch = () => {
const { repoID, repoName, isLibView, path, isViewFile } = this.state;
const { repoID, repoName, isLibView, path, isViewFile, currentRepoInfo } = this.state;
const { searchPlaceholder } = this.props;
const placeholder = searchPlaceholder || gettext('Search files');
@@ -62,9 +63,8 @@ class CommonToolbar extends React.Component {
path={path}
isViewFile={isViewFile}
placeholder={placeholder}
currentRepoInfo={currentRepoInfo}
onSearchedClick={this.props.onSearchedClick}
repoName={repoName}
currentRepoInfo={this.props.currentRepoInfo}
isLibView={isLibView}
/>
);