Skip to content

Commit

Permalink
fix: use new util method
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjaneczek committed Aug 1, 2024
1 parent ebece82 commit 9a19743
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/scenes-app/src/demos/panelTimeRangeHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 9a19743

Please sign in to comment.