Skip to content

Commit

Permalink
fix async compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Apr 8, 2020
1 parent 514561b commit 40e396c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/plugins/data/public/actions/value_click_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,20 @@ export const valueClickActionGetFilters = async (
}> => {
if (!(await isCompatible({ timeFieldName, data }))) {
throw new IncompatibleActionError();
}
// note - the else statement is necessary due to odd compilation behavior
// code after the throw statement can't contain await statements
} else {
const filters: Filter[] =
(await createFiltersFromEvent(data.data || [data], data.negate)) || [];

const filters: Filter[] = (await createFiltersFromEvent(data.data || [data], data.negate)) || [];
let selectedFilters: Filter[] = esFilters.mapAndFlattenFilters(filters);

let selectedFilters: Filter[] = esFilters.mapAndFlattenFilters(filters);
if (selectedFilters.length > 1) {
selectedFilters = await filterSelection(filters);
}

if (selectedFilters.length > 1) {
selectedFilters = await filterSelection(filters);
return esFilters.extractTimeFilter(timeFieldName || '', selectedFilters);
}

return esFilters.extractTimeFilter(timeFieldName || '', selectedFilters);
};

// gets and applies the filters
Expand Down

0 comments on commit 40e396c

Please sign in to comment.