diff --git a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx index 70d59fc7486b2..3caada55b81db 100644 --- a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx @@ -61,6 +61,7 @@ export function LensRenderer({ disabledActions, searchSessionId, hidePanelTitles, + lastReloadRequestTime, ...props }: LensRendererProps) { // Use the settings interface to store panel settings @@ -86,6 +87,11 @@ export function LensRenderer({ const showPanelChrome = Boolean(withDefaultActions) || (extraActions?.length || 0) > 0; + const reload$ = useMemo(() => new BehaviorSubject(undefined), []); + useEffect(() => { + reload$.next(); + }, [reload$, lastReloadRequestTime]); + // Re-render on changes // internally the embeddable will evaluate whether it is worth to actual render or not useEffect(() => { @@ -152,6 +158,7 @@ export function LensRenderer({ attributes: props.attributes, }), hidePanelTitle: hidePanelTitles$, + reload$, // trigger a reload (replacement for deprepcated searchSessionId) })} onApiAvailable={setLensApi} hidePanelChrome={!showPanelChrome}