diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx index fb8bb6c05d8..e56c400c320 100644 --- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx +++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx @@ -71,8 +71,6 @@ const DashboardBuilder = lazy( ), ); -const originalDocumentTitle = document.title; - type PageProps = { idOrSlug: string; }; @@ -204,7 +202,7 @@ export const DashboardPage: FC = ({ idOrSlug }: PageProps) => { document.title = dashboard_title; } return () => { - document.title = originalDocumentTitle; + document.title = 'Superset'; }; }, [dashboard_title]); diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx index 822a54ecafe..af71b790ec1 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/index.jsx @@ -269,6 +269,15 @@ function ExploreViewContainer(props) { const theme = useTheme(); + useEffect(() => { + if (props.sliceName) { + document.title = props.sliceName; + } + return () => { + document.title = 'Superset'; + }; + }, [props.sliceName]); + const addHistory = useCallback( async ({ isReplace = false, title } = {}) => { const formData = props.dashboardId