Skip to content

Commit

Permalink
better names
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Jul 17, 2020
1 parent 339d59f commit 37e821b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x-pack/plugins/maps/public/actions/map_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function generateQueryTimestamp() {
return new Date().toISOString();
}

let lastCalledId: string = '';
let lastSetQueryCallId: string = '';
export function setQuery({
query,
timeFilters,
Expand Down Expand Up @@ -230,13 +230,13 @@ export function setQuery({
// Joins are performed on the client.
// As a result, bounds for join layers must also be performed on the client.
// Therefore join layers need to fetch data prior to auto fitting bounds.
const currentCallId = uuid();
lastCalledId = currentCallId;
const localSetQueryCallId = uuid();
lastSetQueryCallId = localSetQueryCallId;
await dispatch<any>(syncDataForAllJoinLayers());

// setQuery can be triggered before async data fetching completes
// Only continue execution path if setQuery has not been re-triggered.
if (currentCallId === lastCalledId) {
if (localSetQueryCallId === lastSetQueryCallId) {
dispatch(fitToDataBounds());
}
} else {
Expand Down

0 comments on commit 37e821b

Please sign in to comment.