Skip to content

Commit

Permalink
bugfix: in some situations remote.nativeTheme is not found (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Mar 26, 2020
1 parent 4edf2c1 commit dcfafa3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/ui/lib/theme-change-monitor.ts
Expand Up @@ -11,6 +11,10 @@ class ThemeChangeMonitor implements IDisposable {
}

public dispose() {
if (remote.nativeTheme == null) {
return
}

remote.nativeTheme.removeAllListeners()
}

Expand All @@ -19,6 +23,10 @@ class ThemeChangeMonitor implements IDisposable {
return
}

if (remote.nativeTheme == null) {
return
}

remote.nativeTheme.addListener('updated', this.onThemeNotificationFromOS)
}

Expand Down

0 comments on commit dcfafa3

Please sign in to comment.