File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ const Header: FC = () => {
8585 let themeMode = 'light' ;
8686 const { theme, theme_config } = themeSettingStore ( ( _ ) => _ ) ;
8787 if ( theme_config ?. [ theme ] ?. navbar_style ) {
88+ // const color = theme_config[theme].navbar_style.startsWith('#')
8889 themeMode = isLight ( theme_config [ theme ] . navbar_style ) ? 'light' : 'dark' ;
8990 console . log ( 'isLightTheme' , themeMode ) ;
9091 navbarStyle = `theme-${ themeMode } ` ;
Original file line number Diff line number Diff line change @@ -166,7 +166,9 @@ const Index: FC = () => {
166166 const themeConfig = setting . theme_config [ themeName ] ;
167167 const formMeta = { ...formData } ;
168168 formMeta . themes . value = themeName ;
169- formMeta . navbar_style . value = themeConfig ?. navbar_style ;
169+ formMeta . navbar_style . value = themeConfig ?. navbar_style . startsWith ( '#' )
170+ ? themeConfig ?. navbar_style
171+ : DEFAULT_THEME_COLOR ;
170172 formMeta . primary_color . value = themeConfig ?. primary_color ;
171173 formData . color_scheme . value = setting ?. color_scheme || 'system' ;
172174 setFormData ( { ...formMeta } ) ;
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ const store = create<IType>((set) => ({
4242 } ,
4343 update : ( params ) =>
4444 set ( ( state ) => {
45+ // Compatibility default value is colored or light before v1.5.1
46+ if ( ! params . theme_config . default . navbar_style . startsWith ( '#' ) ) {
47+ params . theme_config . default . navbar_style = DEFAULT_THEME_COLOR ;
48+ }
4549 return {
4650 ...state ,
4751 ...params ,
You can’t perform that action at this time.
0 commit comments