From e42c7aba8376b6eb5b4e3b4341c71eb695b0bd16 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 8 Feb 2018 11:28:46 -0800 Subject: [PATCH] disabled auto dark mode if dark mode is selected --- src/renderer/page/settings/view.jsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/renderer/page/settings/view.jsx b/src/renderer/page/settings/view.jsx index 0b061e87a..639d9195e 100644 --- a/src/renderer/page/settings/view.jsx +++ b/src/renderer/page/settings/view.jsx @@ -14,6 +14,8 @@ class SettingsPage extends React.PureComponent { this.state = { clearingCache: false, }; + + this.onAutomaticDarkModeChange = this.onAutomaticDarkModeChange.bind(this); } clearCache() { @@ -62,11 +64,16 @@ class SettingsPage extends React.PureComponent { onThemeChange(event) { const { value } = event.target; + + if (value === 'dark') { + this.onAutomaticDarkModeChange(false); + } + this.props.setClientSetting(settings.THEME, value); } - onAutomaticDarkModeChange(event) { - this.props.setClientSetting(settings.AUTOMATIC_DARK_MODE_ENABLED, event.target.checked); + onAutomaticDarkModeChange(value) { + this.props.setClientSetting(settings.AUTOMATIC_DARK_MODE_ENABLED, value); } onInstantPurchaseEnabledChange(enabled) { @@ -143,6 +150,7 @@ class SettingsPage extends React.PureComponent { ); } + return (
@@ -325,8 +333,9 @@ class SettingsPage extends React.PureComponent { this.onAutomaticDarkModeChange(e.target.checked)} + checked={automaticDarkModeEnabled} label={__('Automatic dark mode (9pm to 8am)')} />