Skip to content

Commit

Permalink
Check if we're working on darwin for subscribe for theme change
Browse files Browse the repository at this point in the history
  • Loading branch information
SwenVanZanten committed Nov 2, 2019
1 parent 8b9ec35 commit ce6f392
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/systemPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { systemPreferences } from 'electron'
/**
* Listen for macOS appearance changes.
*/
systemPreferences.subscribeNotification(
'AppleInterfaceThemeChangedNotification',
function systemThemeChanged () {
console.log('System appearance is DarkMode: ' + systemPreferences.isDarkMode())
// updateMyAppTheme(systemPreferences.isDarkMode())
}
)
if (process.platform === 'darwin') {
systemPreferences.subscribeNotification(
'AppleInterfaceThemeChangedNotification',
function systemThemeChanged () {
console.log('System appearance is DarkMode: ' + systemPreferences.isDarkMode())
// updateMyAppTheme(systemPreferences.isDarkMode())
}
)
}

0 comments on commit ce6f392

Please sign in to comment.