From 9a19743a0f039bd489b3448482db737827b478b8 Mon Sep 17 00:00:00 2001 From: Darren Janeczek Date: Mon, 3 Jun 2024 09:27:40 -0400 Subject: [PATCH] fix: use new util method --- packages/scenes-app/src/demos/panelTimeRangeHandler.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/scenes-app/src/demos/panelTimeRangeHandler.tsx b/packages/scenes-app/src/demos/panelTimeRangeHandler.tsx index 9470ade53..1a32fd89f 100644 --- a/packages/scenes-app/src/demos/panelTimeRangeHandler.tsx +++ b/packages/scenes-app/src/demos/panelTimeRangeHandler.tsx @@ -38,9 +38,7 @@ export function getPanelTimeRangeHandlerDemoScene(defaults: SceneAppPageState): [ (vizPanel: VizPanel) => { patchPanelContext(vizPanel); - const altTimeRangeScene = sceneGraph.findObject(vizPanel, (scene) => { - return scene.state.key === 'altTimeRangeScene'; - }); + const altTimeRangeScene = sceneGraph.findByKey(vizPanel, 'altTimeRangeScene'); function representTimeRangeSelection(selection: TimeRange) { const data = vizPanel.state.$data?.state.data; @@ -67,7 +65,7 @@ export function getPanelTimeRangeHandlerDemoScene(defaults: SceneAppPageState): } vizPanel.state.$data?.setState(newState) - altTimeRangeScene?.state.$timeRange?.onTimeRangeChange(selection); + altTimeRangeScene.state.$timeRange?.onTimeRangeChange(selection); } // Override time range update behavior