1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

Use state change directory array

This commit is contained in:
zxj96
2019-04-23 14:43:47 +08:00
parent 002c3a0dcc
commit 624871fc9c
7 changed files with 50 additions and 33 deletions

View File

@@ -71,6 +71,7 @@ class LibContentView extends React.Component {
errorMsg: '',
isDirentDetailShow: false,
updateDetail: false,
isCurrentPage: false,
};
window.onpopstate = this.onpopstate;
@@ -402,6 +403,7 @@ class LibContentView extends React.Component {
if (!this.state.repoEncrypted && direntList.length) {
this.getThumbnails(repoID, path, this.state.direntList);
}
this.switchPage();
}).catch(() => {
this.setState({
isDirentListLoading: false,
@@ -410,6 +412,14 @@ class LibContentView extends React.Component {
});
}
scrollPage = () => {
this.setState({isCurrentPage: false})
}
switchPage = () => {
this.setState({isCurrentPage: true})
}
getThumbnails = (repoID, path, direntList) => {
let items = direntList.filter((item) => {
return Utils.imageCheck(item.name) && !item.encoded_thumbnail_src;
@@ -1451,6 +1461,8 @@ class LibContentView extends React.Component {
onDeleteRepoTag={this.onDeleteRepoTag}
onToolbarFileTagChanged={this.onToolbarFileTagChanged}
updateDetail={this.state.updateDetail}
isCurrentPage={this.state.isCurrentPage}
scrollPage={this.scrollPage}
/>
{this.state.pathExist && !this.state.isViewFile && (
<FileUploader