mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Make sure to handle the case when search results come back in a different order than retrieved (#15479)
* Make sure to handle the rare case search results come back in a different order than retrieved * Remove unnecessary setting of filter on the state
This commit is contained in:
parent
9df13b2f7a
commit
cb32ef3632
1 changed files with 11 additions and 8 deletions
|
@ -52,15 +52,18 @@ export class VisualizeListingTable extends Component {
|
|||
this.debouncedFetch = _.debounce(filter => {
|
||||
this.props.fetchItems(filter)
|
||||
.then(items => {
|
||||
this.setState({
|
||||
isFetchingItems: false,
|
||||
selectedRowIds: [],
|
||||
filter,
|
||||
});
|
||||
this.items = items;
|
||||
this.calculateItemsOnPage();
|
||||
// We need this check to handle the case where search results come back in a different
|
||||
// order than they were sent out. Only load results for the most recent search.
|
||||
if (filter === this.state.filter) {
|
||||
this.setState({
|
||||
isFetchingItems: false,
|
||||
selectedRowIds: [],
|
||||
});
|
||||
this.items = items;
|
||||
this.calculateItemsOnPage();
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
}, 300);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue