RecentlyViewedDashboards: Hide entire section when there is no recently view item (#115905)

* RecentlyViewedDashboards: Hide entire section when there is no recently view item
This commit is contained in:
Yunwen Zheng
2026-01-07 13:31:48 -05:00
committed by GitHub
parent 41d7213d7e
commit 0c60d356d1
2 changed files with 1 additions and 6 deletions
@@ -39,7 +39,7 @@ export function RecentlyViewedDashboards() {
retry();
};
if (!evaluateBooleanFlag('recentlyViewedDashboards', false)) {
if (!evaluateBooleanFlag('recentlyViewedDashboards', false) || recentDashboards.length === 0) {
return null;
}
@@ -76,10 +76,6 @@ export function RecentlyViewedDashboards() {
</>
)}
{loading && <Spinner />}
{/* TODO: Better empty state https://github.com/grafana/grafana/issues/114804 */}
{!loading && recentDashboards.length === 0 && (
<Text>{t('browse-dashboards.recently-viewed.empty', 'Nothing viewed yet')}</Text>
)}
{!loading && recentDashboards.length > 0 && (
<ul className={styles.list}>
-1
View File
@@ -3759,7 +3759,6 @@
},
"recently-viewed": {
"clear": "Clear history",
"empty": "Nothing viewed yet",
"error": "Recently viewed dashboards couldn’t be loaded.",
"retry": "Retry",
"title": "Recently viewed"