mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
fix bug - move file to searched folder failed (#7247)
Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
@@ -223,9 +223,14 @@ class CopyDirent extends React.Component {
|
||||
};
|
||||
|
||||
onUpdateSearchResults = (results) => {
|
||||
this.setState({
|
||||
searchResults: results
|
||||
});
|
||||
if (results.length > 0) {
|
||||
const firstResult = results[0];
|
||||
this.setState({
|
||||
selectedRepo: new RepoInfo(firstResult),
|
||||
selectedPath: firstResult.path
|
||||
});
|
||||
}
|
||||
this.setState({ searchResults: results });
|
||||
};
|
||||
|
||||
onOpenSearchBar = () => {
|
||||
@@ -240,6 +245,7 @@ class CopyDirent extends React.Component {
|
||||
searchResults: [],
|
||||
selectedSearchedRepo: null,
|
||||
showSearchBar: false,
|
||||
selectedPath: this.props.path,
|
||||
initToShowChildren: mode === MODE_TYPE_MAP.ONLY_CURRENT_LIBRARY,
|
||||
});
|
||||
};
|
||||
@@ -279,7 +285,7 @@ class CopyDirent extends React.Component {
|
||||
|
||||
onDirentItemClick = (repo, selectedPath) => {
|
||||
this.setState({
|
||||
repo: repo,
|
||||
selectedRepo: repo,
|
||||
selectedPath: selectedPath,
|
||||
errMessage: ''
|
||||
});
|
||||
|
@@ -236,15 +236,20 @@ class MoveDirent extends React.Component {
|
||||
};
|
||||
|
||||
onUpdateSearchResults = (results) => {
|
||||
this.setState({
|
||||
searchResults: results
|
||||
});
|
||||
if (results.length > 0) {
|
||||
const firstResult = results[0];
|
||||
this.setState({
|
||||
selectedRepo: new RepoInfo(firstResult),
|
||||
selectedPath: firstResult.path
|
||||
});
|
||||
}
|
||||
this.setState({ searchResults: results });
|
||||
};
|
||||
|
||||
onDirentItemClick = (repo, selectedPath) => {
|
||||
this.setState({
|
||||
selectedPath: selectedPath,
|
||||
repo,
|
||||
selectedRepo: repo,
|
||||
errMessage: '',
|
||||
});
|
||||
};
|
||||
@@ -261,6 +266,7 @@ class MoveDirent extends React.Component {
|
||||
searchResults: [],
|
||||
selectedSearchedRepo: null,
|
||||
showSearchBar: false,
|
||||
selectedPath: this.props.path,
|
||||
initToShowChildren: mode === MODE_TYPE_MAP.ONLY_CURRENT_LIBRARY,
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user