mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Return original document title when leaving a dashboard (#16323)
* Return original title on unmount * Name var originalDocumentTitle
This commit is contained in:
@@ -42,6 +42,8 @@ const DashboardContainer = React.lazy(
|
||||
),
|
||||
);
|
||||
|
||||
const originalDocumentTitle = document.title;
|
||||
|
||||
const DashboardPage: FC = () => {
|
||||
const dispatch = useDispatch();
|
||||
const { addDangerToast } = useToasts();
|
||||
@@ -71,6 +73,9 @@ const DashboardPage: FC = () => {
|
||||
if (dashboard_title) {
|
||||
document.title = dashboard_title;
|
||||
}
|
||||
return () => {
|
||||
document.title = originalDocumentTitle;
|
||||
};
|
||||
}, [dashboard_title]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user