mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(theme): migrate APP_NAME to brandAppName theme token with backward compatibility (#37370)
Co-authored-by: Rafael Benitez <rebenitez1802@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3ca8c998ab
commit
760227d630
@@ -291,15 +291,28 @@ function ExploreViewContainer(props) {
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
// Capture original title before any effects run
|
||||
const originalTitle = useMemo(() => document.title, []);
|
||||
|
||||
// Update document title when slice name changes
|
||||
useEffect(() => {
|
||||
if (props.sliceName) {
|
||||
document.title = props.sliceName;
|
||||
}
|
||||
return () => {
|
||||
document.title = 'Superset';
|
||||
};
|
||||
}, [props.sliceName]);
|
||||
|
||||
// Restore original title on unmount
|
||||
useEffect(
|
||||
() => () => {
|
||||
document.title =
|
||||
originalTitle ||
|
||||
theme?.brandAppName ||
|
||||
theme?.brandLogoAlt ||
|
||||
'Superset';
|
||||
},
|
||||
[originalTitle, theme?.brandAppName, theme?.brandLogoAlt],
|
||||
);
|
||||
|
||||
const addHistory = useCallback(
|
||||
async ({ isReplace = false, title } = {}) => {
|
||||
const formData = props.dashboardId
|
||||
|
||||
Reference in New Issue
Block a user