Skip to content

Commit

Permalink
update navigation_panel snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Aug 6, 2020
1 parent 95c05bb commit 5a7398a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x-pack/plugins/maps/public/actions/data_request_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,16 @@ export function fitToDataBounds(onNoBounds?: () => void) {
let lastSetQueryCallId: string = '';
export function autoFitToBounds() {
return async (dispatch: Dispatch) => {
// Method can be triggered before async actions complete
// Use localSetQueryCallId to only continue execution path if method has not been re-triggered.
const localSetQueryCallId = uuid();
lastSetQueryCallId = localSetQueryCallId;

// 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 localSetQueryCallId = uuid();
lastSetQueryCallId = localSetQueryCallId;
await dispatch<any>(syncDataForAllJoinLayers());

// autoFitToBounds can be triggered before async data fetching completes
// Only continue execution path if autoFitToBounds has not been re-triggered.
if (localSetQueryCallId === lastSetQueryCallId) {
// In cases where there are no bounds, such as no matching documents, fitToDataBounds does not trigger setGotoWithBounds.
// Ensure layer syncing occurs when setGotoWithBounds is not triggered.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5a7398a

Please sign in to comment.