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