From 15de8a5433fdf10f7d41c15cb65eb6e0a8ad07f9 Mon Sep 17 00:00:00 2001 From: Juan Cabanas Date: Wed, 23 Oct 2024 11:08:28 -0300 Subject: [PATCH] SharedDashboard: Fix refresh when time picker is hidden (#95258) --- .../pages/PublicDashboardScenePage.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx index 6c21c6845b3..c55d4bbcce9 100644 --- a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx +++ b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.tsx @@ -59,9 +59,12 @@ export function PublicDashboardScenePage({ route }: Props) { return ; } + // if no time picker render without url sync + if (dashboard.state.controls?.state.hideTimeControls) { + return ; + } + return ( - // url sync is needed with or without time picker enabled to make refresh work - // the backend sanitizes the request payload @@ -75,6 +78,10 @@ function PublicDashboardSceneRenderer({ model }: SceneComponentProps { + return refreshPicker.activate(); + }, [refreshPicker]); + useEffect(() => { setIsActive(true); return model.activate();