Skip to content

Commit

Permalink
fix: undefined browser (janhq#3011)
Browse files Browse the repository at this point in the history
electron is not available
  • Loading branch information
phoval authored Jun 10, 2024
1 parent 0cae7c9 commit 57177d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/hooks/useLoadTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export const useLoadTheme = async () => {
const setNativeTheme = useCallback(
(nativeTheme: NativeThemeProps) => {
if (nativeTheme === 'dark') {
window?.electronAPI.setNativeThemeDark()
window?.electronAPI?.setNativeThemeDark()
setTheme('dark')
localStorage.setItem('nativeTheme', 'dark')
} else {
window?.electronAPI.setNativeThemeLight()
window?.electronAPI?.setNativeThemeLight()
setTheme('light')
localStorage.setItem('nativeTheme', 'light')
}
Expand Down

0 comments on commit 57177d4

Please sign in to comment.