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 = () => {
85
85
let themeMode = 'light' ;
86
86
const { theme, theme_config } = themeSettingStore ( ( _ ) => _ ) ;
87
87
if ( theme_config ?. [ theme ] ?. navbar_style ) {
88
+ // const color = theme_config[theme].navbar_style.startsWith('#')
88
89
themeMode = isLight ( theme_config [ theme ] . navbar_style ) ? 'light' : 'dark' ;
89
90
console . log ( 'isLightTheme' , themeMode ) ;
90
91
navbarStyle = `theme-${ themeMode } ` ;
Original file line number Diff line number Diff line change @@ -166,7 +166,9 @@ const Index: FC = () => {
166
166
const themeConfig = setting . theme_config [ themeName ] ;
167
167
const formMeta = { ...formData } ;
168
168
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 ;
170
172
formMeta . primary_color . value = themeConfig ?. primary_color ;
171
173
formData . color_scheme . value = setting ?. color_scheme || 'system' ;
172
174
setFormData ( { ...formMeta } ) ;
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ const store = create<IType>((set) => ({
42
42
} ,
43
43
update : ( params ) =>
44
44
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
+ }
45
49
return {
46
50
...state ,
47
51
...params ,
You can’t perform that action at this time.
0 commit comments