Skip to content

Commit

Permalink
#10276 debounce full refreshes of grid data
Browse files Browse the repository at this point in the history
  • Loading branch information
siemiatj committed Dec 4, 2020
1 parent 6e70084 commit c8b63d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/containers/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import { Set as iSet } from 'immutable';
import currentDevice from 'current-device';
import { get } from 'lodash';
import { get, debounce } from 'lodash';
import deepUnfreeze from 'deep-unfreeze';
import { LOCATION_SEARCH_NAME } from '../constants/Constants';
import { locationSearchRequest, getViewRowsByIds } from '../api';
Expand Down Expand Up @@ -74,6 +74,8 @@ class DocumentListContainer extends Component {

this.fetchLayoutAndData();
this.renderedSuccessfuly = false;

this.debouncedRefresh = debounce(this.browseView, 500, { maxWait: 10000 });
}

UNSAFE_componentWillMount() {
Expand Down Expand Up @@ -252,7 +254,7 @@ class DocumentListContainer extends Component {
}

if (fullyChanged === true) {
this.browseView();
this.debouncedRefresh();
}
});
};
Expand Down

0 comments on commit c8b63d4

Please sign in to comment.