Fixing requesting items multiple times on scroll on mobile
This commit is contained in:
@@ -6,6 +6,7 @@ import {startSetStorage} from "./storage"
|
||||
import uuid from "uuid";
|
||||
import axios from "axios";
|
||||
import env from "../enviroment/envFrontEnd";
|
||||
import mobileCheck from "../utils/mobileCheck";
|
||||
const http = require('http');
|
||||
const https = require('https');
|
||||
|
||||
@@ -87,6 +88,10 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star
|
||||
}
|
||||
|
||||
dispatch(loadMoreFiles(results.data))
|
||||
|
||||
if (mobileCheck()) {
|
||||
dispatch(setLoading(false));
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
import {startLoadMoreFiles} from "../../actions/files";
|
||||
import {startSetSelectedItem, setLastSelected} from "../../actions/selectedItem";
|
||||
import {setLoading} from "../../actions/main";
|
||||
import {setPopupFile} from "../../actions/popupFile";
|
||||
import mobileCheck from "../../utils/mobileCheck"
|
||||
import MainSection from "./MainSection";
|
||||
@@ -79,6 +80,7 @@ class MainSectionContainer extends React.Component {
|
||||
const lastFileDate = this.props.files[this.props.files.length - 1].uploadDate
|
||||
const lastFileName = this.props.files[this.props.files.length - 1].filename
|
||||
|
||||
this.props.dispatch(setLoading(true));
|
||||
this.props.dispatch(startLoadMoreFiles(parent, sortBy, search, lastFileDate, lastFileName));
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user