diff --git a/public/app/features/dashboard/containers/DashboardPage.tsx b/public/app/features/dashboard/containers/DashboardPage.tsx index 2f1b1e16fb8..5578ff93dd0 100644 --- a/public/app/features/dashboard/containers/DashboardPage.tsx +++ b/public/app/features/dashboard/containers/DashboardPage.tsx @@ -458,19 +458,6 @@ function updateStatePageNavFromProps(props: Props, state: State): State { }; } - const { folderUid } = dashboard.meta; - if (folderUid && pageNav) { - const folderNavModel = getNavModel(navIndex, `folder-dashboards-${folderUid}`).main; - // If the folder hasn't loaded (maybe user doesn't have permission on it?) then - // don't show the "page not found" breadcrumb - if (folderNavModel.id !== 'not-found') { - pageNav = { - ...pageNav, - parentItem: folderNavModel, - }; - } - } - if (props.route.routeName === DashboardRoutes.Path) { sectionNav = getRootContentNavModel(); const pageNav = getPageNavFromSlug(props.match.params.slug!); @@ -485,6 +472,19 @@ function updateStatePageNavFromProps(props: Props, state: State): State { ); } + const { folderUid } = dashboard.meta; + if (folderUid && pageNav && sectionNav.main.id !== 'starred') { + const folderNavModel = getNavModel(navIndex, `folder-dashboards-${folderUid}`).main; + // If the folder hasn't loaded (maybe user doesn't have permission on it?) then + // don't show the "page not found" breadcrumb + if (folderNavModel.id !== 'not-found') { + pageNav = { + ...pageNav, + parentItem: folderNavModel, + }; + } + } + if (state.editPanel || state.viewPanel) { pageNav = { ...pageNav,