Clears resolved arg on embeddable destroy (#109945)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Catherine Liu 2021-08-26 23:46:11 -07:00 committed by GitHub
parent dde701faaa
commit 2e4e0fca4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ import {
import { setFilter } from '../state/actions/elements';
import { updateEmbeddableExpression, fetchEmbeddableRenderable } from '../state/actions/embeddable';
import { RendererHandlers, CanvasElement } from '../../types';
import { clearValue } from '../state/actions/resolved_args';
// This class creates stub handlers to ensure every element and renderer fulfills the contract.
// TODO: consider warning if these methods are invoked but not implemented by the renderer...?
@ -123,6 +124,8 @@ export const createDispatchedHandlerFactory = (
},
onEmbeddableDestroyed() {
const argumentPath = [element.id, 'expressionRenderable'];
dispatch(clearValue({ path: argumentPath }));
dispatch(fetchEmbeddableRenderable(element.id));
},