mirror of https://github.com/apache/superset.git
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 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(() => {
|
||||
|
|
Loading…
Reference in New Issue