1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 19:29:56 +00:00

fix code format (#6365)

This commit is contained in:
Michael An
2024-07-18 11:58:42 +08:00
committed by GitHub
parent c5d02b33b2
commit 67210c7363
450 changed files with 2425 additions and 2385 deletions

View File

@@ -47,7 +47,7 @@ class FileChooser extends React.Component {
}
componentDidMount() {
if (this.props.repoID) { // current_repo_and_other_repos, only_current_library
if (this.props.repoID) { // current_repo_and_other_repos, only_current_library
let repoID = this.props.repoID;
seafileAPI.getRepoInfo(repoID).then(res => {
// need to optimized
@@ -65,7 +65,7 @@ class FileChooser extends React.Component {
let repos = res.data.repos;
let repoList = [];
let repoIdList = [];
for(let i = 0; i < repos.length; i++) {
for (let i = 0; i < repos.length; i++) {
if (repos[i].permission !== 'rw') {
continue;
}
@@ -76,7 +76,7 @@ class FileChooser extends React.Component {
repoIdList.push(repos[i].repo_id);
}
repoList = Utils.sortRepos(repoList, 'name', 'asc');
this.setState({repoList: repoList});
this.setState({ repoList: repoList });
});
}
}
@@ -89,7 +89,7 @@ class FileChooser extends React.Component {
let repos = res.data.repos;
let repoList = [];
let repoIdList = [];
for(let i = 0; i < repos.length; i++) {
for (let i = 0; i < repos.length; i++) {
if (repos[i].permission !== 'rw') {
continue;
}
@@ -111,12 +111,12 @@ class FileChooser extends React.Component {
});
}
else {
this.setState({isOtherRepoShow: !this.state.isOtherRepoShow});
this.setState({ isOtherRepoShow: !this.state.isOtherRepoShow });
}
};
onCurrentRepoToggle = () => {
this.setState({isCurrentRepoShow: !this.state.isCurrentRepoShow});
this.setState({ isCurrentRepoShow: !this.state.isCurrentRepoShow });
};
onDirentItemClick = (repo, filePath, dirent) => {
@@ -152,7 +152,7 @@ class FileChooser extends React.Component {
onSearchInfoChanged = (event) => {
let searchInfo = event.target.value.trim();
this.setState({searchInfo: searchInfo});
this.setState({ searchInfo: searchInfo });
if (this.inputValue === searchInfo) {
return false;
@@ -176,7 +176,7 @@ class FileChooser extends React.Component {
}
if (this.inputValue === '' || this.getValueLength(this.inputValue) < 3) {
this.setState({isResultGot: false});
this.setState({ isResultGot: false });
return false;
}
@@ -204,7 +204,7 @@ class FileChooser extends React.Component {
this.cancelRequest();
}
this.setState({isResultGot: false});
this.setState({ isResultGot: false });
this.source = seafileAPI.getSource();
this.sendRequest(queryData, this.source.token);
@@ -235,10 +235,10 @@ class FileChooser extends React.Component {
};
getValueLength = (str) => {
var i = 0, code, len = 0;
var i = 0; var code; var len = 0;
for (; i < str.length; i++) {
code = str.charCodeAt(i);
if (code == 10) { //solve enter problem
if (code == 10) { // solve enter problem
len += 2;
} else if (code < 0x007f) {
len += 1;
@@ -361,7 +361,7 @@ class FileChooser extends React.Component {
});
}
else {
this.setState({isOtherRepoShow: !this.state.isOtherRepoShow});
this.setState({ isOtherRepoShow: !this.state.isOtherRepoShow });
}
}
this.onCloseSearching();