File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
superset-frontend/src/components Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 19
19
import { ReactNode , useEffect , useState } from 'react' ;
20
20
import { useThemeContext } from 'src/theme/ThemeProvider' ;
21
21
import { Theme } from '@superset-ui/core' ;
22
+ import { Loading } from '@superset-ui/core/components' ;
22
23
23
24
interface CrudThemeProviderProps {
24
25
children : ReactNode ;
@@ -62,11 +63,16 @@ export default function CrudThemeProvider({
62
63
}
63
64
} , [ themeId , globalThemeContext ] ) ;
64
65
65
- // If no dashboard theme , just render children (they use global theme)
66
- if ( ! themeId || ! dashboardTheme ) {
66
+ // If no themeId , just render children (they use global theme)
67
+ if ( ! themeId ) {
67
68
return < > { children } </ > ;
68
69
}
69
70
71
+ // If themeId exists, but theme is not loaded yet, return null to prevent re-mounting children
72
+ if ( ! dashboardTheme ) {
73
+ return < Loading /> ;
74
+ }
75
+
70
76
// Render children with the dashboard theme provider from controller
71
77
return (
72
78
< dashboardTheme . SupersetThemeProvider >
You can’t perform that action at this time.
0 commit comments