parent
0cae7c9761
commit
57177d4409
@ -29,11 +29,11 @@ export const useLoadTheme = async () => {
|
|||||||
const setNativeTheme = useCallback(
|
const setNativeTheme = useCallback(
|
||||||
(nativeTheme: NativeThemeProps) => {
|
(nativeTheme: NativeThemeProps) => {
|
||||||
if (nativeTheme === 'dark') {
|
if (nativeTheme === 'dark') {
|
||||||
window?.electronAPI.setNativeThemeDark()
|
window?.electronAPI?.setNativeThemeDark()
|
||||||
setTheme('dark')
|
setTheme('dark')
|
||||||
localStorage.setItem('nativeTheme', 'dark')
|
localStorage.setItem('nativeTheme', 'dark')
|
||||||
} else {
|
} else {
|
||||||
window?.electronAPI.setNativeThemeLight()
|
window?.electronAPI?.setNativeThemeLight()
|
||||||
setTheme('light')
|
setTheme('light')
|
||||||
localStorage.setItem('nativeTheme', 'light')
|
localStorage.setItem('nativeTheme', 'light')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user