|
@@ -121,8 +121,8 @@ class _GenericDiscoverQuery<T, P> extends React.Component<Props<T, P>, State<T>>
|
|
|
}
|
|
|
|
|
|
componentDidUpdate(prevProps: Props<T, P>) {
|
|
|
- // Reload data if we aren't already loading,
|
|
|
- const refetchCondition = !this.state.isLoading && this._shouldRefetchData(prevProps);
|
|
|
+ // Reload data if the payload changes
|
|
|
+ const refetchCondition = this._shouldRefetchData(prevProps);
|
|
|
|
|
|
// or if we've moved from an invalid view state to a valid one,
|
|
|
const eventViewValidation =
|
|
@@ -199,6 +199,9 @@ class _GenericDiscoverQuery<T, P> extends React.Component<Props<T, P>, State<T>>
|
|
|
|
|
|
beforeFetch?.(api);
|
|
|
|
|
|
+ // clear any inflight requests since they are now stale
|
|
|
+ api.clear();
|
|
|
+
|
|
|
try {
|
|
|
const [data, , resp] = await doDiscoverQuery<T>(api, url, apiPayload);
|
|
|
if (this.state.tableFetchID !== tableFetchID) {
|