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; }