From 698cf6de771397fa47e1d656b9cbcf0ab23d9d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 17 Mar 2021 18:03:21 +0100 Subject: [PATCH] [v7.5.x] TimePicker: Fixes hidden time picker shown in kiosk TV mode (#32055) --- .../dashboard/components/DashNav/DashNav.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx index 645fcb71d89..03833ddd740 100644 --- a/public/app/features/dashboard/components/DashNav/DashNav.tsx +++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx @@ -197,14 +197,19 @@ class DashNav extends PureComponent { const tvButton = ( ); - const timeControls = ( - - ); + + let timeControls: React.ReactNode | null; + + if (!dashboard.timepicker.hidden) { + timeControls = ( + + ); + } if (this.isPlaylistRunning()) { return [this.renderPlaylistControls(), timeControls]; @@ -252,11 +257,7 @@ class DashNav extends PureComponent { } this.addCustomContent(customRightActions, buttons); - - if (!dashboard.timepicker.hidden) { - buttons.push(timeControls); - } - + buttons.push(timeControls); buttons.push(tvButton); return buttons; }