fixed issue with loading more

This commit is contained in:
kyle hoell
2020-11-28 21:53:05 -05:00
parent a82850053c
commit a4bff813b1
3 changed files with 20 additions and 4 deletions
+4 -2
View File
@@ -296,7 +296,7 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
return (dispatch) => {
dispatch(setLoading(true))
//dispatch(setLoading(true))
let limit = window.localStorage.getItem("list-size") || 50
limit = parseInt(limit)
@@ -316,7 +316,7 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
dispatch(loadMoreItems(true))
}
dispatch(setLoading(false))
//dispatch(setLoading(false))
}).catch((err) => {
console.log(err)
@@ -326,6 +326,8 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
axios.get(currentURL +`/file-service/list?limit=${limit}&parent=${parent}&sortby=${sortby}&search=${search}&startAt=${true}&startAtDate=${startAtDate}&startAtName=${startAtName}`).then((results) => {
//console.log("load more files result", results.data.length)
dispatch(loadMoreFiles(results.data))
if (results.data.length !== limit) {
+4
View File
@@ -55,6 +55,10 @@ class DataFormContainer extends React.Component {
loadMoreItems = () => {
// return;
console.log("load more items dataform");
let limit = window.localStorage.getItem("list-size") || 50
limit = parseInt(limit)
+12 -2
View File
@@ -73,7 +73,9 @@ class MainSectionContainer extends React.Component {
scrollEvent = (e) => {
if (!mobileCheck()) return;
//if (!mobileCheck()) return;
return;
const scrollY = window.pageYOffset;
const windowY = document.documentElement.scrollHeight;
@@ -84,7 +86,9 @@ class MainSectionContainer extends React.Component {
if (this.props.loading) return;
if ((windowY / 2) < scrollY && this.props.allowLoadMoreItems) {
console.log("load more main")
if (this.props.files.length >= limit) {
const parent = this.props.parent;
const search = this.props.filter.search;
@@ -108,6 +112,8 @@ class MainSectionContainer extends React.Component {
componentDidUpdate = () => {
console.log("main updated");
// console.log("update ID main", getUpdateSettingsID());
// if (this.lastSettingsUpdateID !== getUpdateSettingsID()) {
@@ -191,6 +197,10 @@ class MainSectionContainer extends React.Component {
}
loadMoreItems = () => {
return;
console.log("load more main")
if (mobileCheck()) return;