Skip to content

Commit

Permalink
Fixed duplication of create new modal (#86489)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson authored Dec 18, 2020
1 parent b5197a3 commit 319a407
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useKibana } from '../../services/kibana_react';
import { IndexPattern, SavedQuery, TimefilterContract } from '../../services/data';
import {
EmbeddableFactoryNotFoundError,
EmbeddableInput,
isErrorEmbeddable,
openAddPanelFlyout,
ViewMode,
Expand Down Expand Up @@ -135,10 +136,7 @@ export function DashboardTopNav({
if (!factory) {
throw new EmbeddableFactoryNotFoundError(type);
}
const explicitInput = await factory.getExplicitInput();
if (dashboardContainer) {
await dashboardContainer.addNewEmbeddable(type, explicitInput);
}
await factory.create({} as EmbeddableInput, dashboardContainer);
}, [dashboardContainer, embeddable]);

const onChangeViewMode = useCallback(
Expand Down

0 comments on commit 319a407

Please sign in to comment.