fix: code style init value
This commit is contained in:
parent
8491141edc
commit
612b39a878
@ -24,8 +24,11 @@ export const SyntaxHighlighterProvider: React.FC<PropsWithChildren> = ({ childre
|
||||
const { codeStyle } = useSettings()
|
||||
|
||||
const highlighterTheme = useMemo(() => {
|
||||
if (codeStyle === 'auto') return theme === ThemeMode.light ? 'one-light' : 'material-theme-darker'
|
||||
else return codeStyle
|
||||
if (!codeStyle || codeStyle === 'auto') {
|
||||
return theme === ThemeMode.light ? 'one-light' : 'material-theme-darker'
|
||||
}
|
||||
|
||||
return codeStyle
|
||||
}, [theme, codeStyle])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -24,7 +24,7 @@ const persistedReducer = persistReducer(
|
||||
{
|
||||
key: 'cherry-studio',
|
||||
storage,
|
||||
version: 38,
|
||||
version: 39,
|
||||
blacklist: ['runtime'],
|
||||
migrate
|
||||
},
|
||||
|
||||
@ -669,6 +669,10 @@ const migrateConfig = {
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
'39': (state: RootState) => {
|
||||
state.settings.codeStyle = 'auto'
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user