Skip to content

Commit

Permalink
Clears resolved arg on embeddable destroy (elastic#109945) (elastic#1…
Browse files Browse the repository at this point in the history
…10393)

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Catherine Liu <[email protected]>
  • Loading branch information
kibanamachine and cqliu1 authored Aug 27, 2021
1 parent 0ea0b64 commit aacdc90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/canvas/public/lib/create_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...?
Expand Down Expand Up @@ -123,6 +124,8 @@ export const createDispatchedHandlerFactory = (
},

onEmbeddableDestroyed() {
const argumentPath = [element.id, 'expressionRenderable'];
dispatch(clearValue({ path: argumentPath }));
dispatch(fetchEmbeddableRenderable(element.id));
},

Expand Down

0 comments on commit aacdc90

Please sign in to comment.