From 8436a38ab929c8ce13133faf8fda22a716fd5d95 Mon Sep 17 00:00:00 2001 From: kytwb Date: Sun, 9 Jan 2022 16:59:09 +0100 Subject: #1675 Fix Adaptable Dark Mode --- src/stores/UIStore.js | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index 9c194aa91..091b9b8eb 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js @@ -1,9 +1,8 @@ import { action, observable, computed, reaction } from 'mobx'; -import { nativeTheme, systemPreferences } from '@electron/remote'; +import { nativeTheme } from '@electron/remote'; import { theme, ThemeType } from '../themes'; import Store from './lib/Store'; -import { isMac, isWindows } from '../environment'; export default class UIStore extends Store { @observable showServicesUpdatedInfoBar = false; @@ -20,23 +19,11 @@ export default class UIStore extends Store { this._toggleServiceUpdatedInfoBar.bind(this), ); - // Listen for theme change on MacOS - if (isMac) { - systemPreferences.subscribeNotification( - 'AppleInterfaceThemeChangedNotification', - () => { - this.isOsDarkThemeActive = nativeTheme.shouldUseDarkColors; - this.actions.service.shareSettingsWithServiceProcess(); - }, - ); - } - - if (isWindows) { - nativeTheme.on('updated', () => { - this.isOsDarkThemeActive = nativeTheme.shouldUseDarkColors; - this.actions.service.shareSettingsWithServiceProcess(); - }); - } + // Listen for theme change + nativeTheme.on('updated', () => { + this.isOsDarkThemeActive = nativeTheme.shouldUseDarkColors; + this.actions.service.shareSettingsWithServiceProcess(); + }); } setup() { -- cgit v1.2.3-54-g00ecf