Skip to content

Commit

Permalink
Web: Files: withLoader: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kulak committed Jan 19, 2022
1 parent 1a1d597 commit efbfb62
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions products/ASC.Files/Client/src/HOCs/withLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ let loadTimeout = null;

const withLoader = (WrappedComponent) => (Loader) => {
const withLoader = (props) => {
const {
tReady,
firstLoad,
isLoaded,
isLoading,
viewAs,
sectionWidth,
} = props;
const { tReady, firstLoad, isLoaded, isLoading, viewAs } = props;
const [inLoad, setInLoad] = useState(false);

const cleanTimer = () => {
Expand All @@ -30,10 +23,12 @@ const withLoader = (WrappedComponent) => (Loader) => {
if (isLoading) {
cleanTimer();
loadTimeout = setTimeout(() => {
//console.log('inLoad', true)
setInLoad(true);
}, 500);
} else {
cleanTimer();
//console.log('inLoad', false)
setInLoad(false);
}

Expand Down

0 comments on commit efbfb62

Please sign in to comment.