From 8aab8699e02ed9ec736bb6dfab0edd3fe9156c8d Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 27 Mar 2018 21:25:56 +0200 Subject: Split settings into multiple stores; app specific settings are now stored in config file --- src/containers/layout/AppLayoutContainer.js | 6 ++--- src/containers/settings/EditSettingsScreen.js | 32 +++++++++------------------ 2 files changed, 13 insertions(+), 25 deletions(-) (limited to 'src/containers') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 075bd5e34..0931738fd 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -77,7 +77,7 @@ export default class AppLayoutContainer extends Component { ); @@ -99,7 +99,7 @@ export default class AppLayoutContainer extends Component { setWebviewReference={setWebviewReference} openWindow={openWindow} reload={reload} - isAppMuted={settings.all.isAppMuted} + isAppMuted={settings.all.app.isAppMuted} update={updateService} /> ); diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index e67c2964b..1bd147099 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js @@ -55,10 +55,6 @@ const messages = defineMessages({ id: 'settings.app.form.spellcheckingLanguage', defaultMessage: '!!!Language for spell checking', }, - // spellcheckingAutomaticDetection: { - // id: 'settings.app.form.spellcheckingAutomaticDetection', - // defaultMessage: '!!!Detect language automatically', - // }, beta: { id: 'settings.app.form.beta', defaultMessage: '!!!Include beta versions', @@ -84,13 +80,16 @@ export default class EditSettingsScreen extends Component { }); settings.update({ - settings: { + type: 'app', + data: { runInBackground: settingsData.runInBackground, enableSystemTray: settingsData.enableSystemTray, minimizeToSystemTray: settingsData.minimizeToSystemTray, showDisabledServices: settingsData.showDisabledServices, showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, enableSpellchecking: settingsData.enableSpellchecking, + beta: settingsData.beta, // we need this info in the main process as well + locale: settingsData.locale, // we need this info in the main process as well }, }); @@ -114,17 +113,6 @@ export default class EditSettingsScreen extends Component { }); }); - // const spellcheckerLocales = [{ - // value: 'auto', - // label: intl.formatMessage(messages.spellcheckingAutomaticDetection), - // }]; - // Object.keys(SPELLCHECKER_LOCALES).forEach((key) => { - // spellcheckerLocales.push({ - // value: key, - // label: SPELLCHECKER_LOCALES[key], - // }); - // }); - const config = { fields: { autoLaunchOnStart: { @@ -139,32 +127,32 @@ export default class EditSettingsScreen extends Component { }, runInBackground: { label: intl.formatMessage(messages.runInBackground), - value: settings.all.runInBackground, + value: settings.all.app.runInBackground, default: DEFAULT_APP_SETTINGS.runInBackground, }, enableSystemTray: { label: intl.formatMessage(messages.enableSystemTray), - value: settings.all.enableSystemTray, + value: settings.all.app.enableSystemTray, default: DEFAULT_APP_SETTINGS.enableSystemTray, }, minimizeToSystemTray: { label: intl.formatMessage(messages.minimizeToSystemTray), - value: settings.all.minimizeToSystemTray, + value: settings.all.app.minimizeToSystemTray, default: DEFAULT_APP_SETTINGS.minimizeToSystemTray, }, showDisabledServices: { label: intl.formatMessage(messages.showDisabledServices), - value: settings.all.showDisabledServices, + value: settings.all.app.showDisabledServices, default: DEFAULT_APP_SETTINGS.showDisabledServices, }, showMessageBadgeWhenMuted: { label: intl.formatMessage(messages.showMessageBadgeWhenMuted), - value: settings.all.showMessageBadgeWhenMuted, + value: settings.all.app.showMessageBadgeWhenMuted, default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, }, enableSpellchecking: { label: intl.formatMessage(messages.enableSpellchecking), - value: settings.all.enableSpellchecking, + value: settings.all.app.enableSpellchecking, default: DEFAULT_APP_SETTINGS.enableSpellchecking, }, locale: { -- cgit v1.2.3-70-g09d2