Web.Files: TreeFolders, EmptyFolderContainer: fix problem with paging
This commit is contained in:
parent
102f838a6a
commit
4a30872a15
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { TreeMenu, TreeNode, Icons, toastr, utils } from "asc-web-components";
|
||||
import { fetchFolder } from "../../../store/files/actions";
|
||||
import { fetchFolder, fetchFiles } from "../../../store/files/actions";
|
||||
import store from "../../../store/store";
|
||||
import { api, history } from "asc-web-common";
|
||||
const { files } = api;
|
||||
@ -65,7 +65,8 @@ class TreeFolders extends React.Component {
|
||||
? ""
|
||||
: "/";
|
||||
history.push(`${url}${symbol}#${data[0]}`);
|
||||
fetchFolder(data[0], store.dispatch).catch(err =>
|
||||
const newFilter = this.props.filter.clone();
|
||||
fetchFiles(data[0], newFilter, store.dispatch).catch(err =>
|
||||
toastr.error("Something went wrong", err)
|
||||
);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { EmptyScreenContainer, Link } from "asc-web-components";
|
||||
import { fetchFolder } from "../../../../../store/files/actions";
|
||||
import { fetchFiles } from "../../../../../store/files/actions";
|
||||
import store from "../../../../../store/store";
|
||||
import { history } from "asc-web-common";
|
||||
|
||||
@ -44,7 +44,8 @@ const EmptyFolderContainer = props => {
|
||||
console.log("Create presentation click");
|
||||
const onCreateFolderClick = () => console.log("Create folder click");
|
||||
const onBackToParentFolder = () => {
|
||||
fetchFolder(props.parentId, store.dispatch);
|
||||
const newFilter = props.filter.clone();
|
||||
fetchFiles(props.parentId, newFilter, store.dispatch);
|
||||
const url =
|
||||
history.location.search !== ""
|
||||
? history.location.search
|
||||
|
@ -184,7 +184,7 @@ class SectionBodyContent extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { files, folders, viewer, parentId, folderId, settings, selection, fileAction, onLoading } = this.props;
|
||||
const { files, folders, viewer, parentId, folderId, settings, selection, fileAction, onLoading, filter } = this.props;
|
||||
const { editingId } = this.state;
|
||||
|
||||
let items = [...folders, ...files];
|
||||
@ -229,7 +229,7 @@ class SectionBodyContent extends React.PureComponent {
|
||||
})}
|
||||
</RowContainer>
|
||||
) : parentId !== 0 ? (
|
||||
<EmptyFolderContainer parentId={parentId} />
|
||||
<EmptyFolderContainer parentId={parentId} filter={filter}/>
|
||||
) : <p>RootFolderContainer</p>;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user