aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings/EditSettingsScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/settings/EditSettingsScreen.js')
-rw-r--r--src/containers/settings/EditSettingsScreen.js49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index ea1d319d9..f1706a721 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -12,8 +12,11 @@ import { gaPage } from '../../lib/analytics';
12import { DEFAULT_APP_SETTINGS } from '../../config'; 12import { DEFAULT_APP_SETTINGS } from '../../config';
13import { config as spellcheckerConfig } from '../../features/spellchecker'; 13import { config as spellcheckerConfig } from '../../features/spellchecker';
14 14
15import { getSelectOptions } from '../../helpers/i18n-helpers';
16
15 17
16import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; 18import EditSettingsForm from '../../components/settings/settings/EditSettingsForm';
19import ErrorBoundary from '../../components/util/ErrorBoundary';
17 20
18const messages = defineMessages({ 21const messages = defineMessages({
19 autoLaunchOnStart: { 22 autoLaunchOnStart: {
@@ -116,20 +119,12 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
116 const { app, settings, user } = this.props.stores; 119 const { app, settings, user } = this.props.stores;
117 const { intl } = this.context; 120 const { intl } = this.context;
118 121
119 const locales = []; 122 const locales = getSelectOptions({
120 Object.keys(APP_LOCALES).sort(Intl.Collator().compare).forEach((key) => { 123 locales: APP_LOCALES,
121 locales.push({
122 value: key,
123 label: APP_LOCALES[key],
124 });
125 }); 124 });
126 125
127 const spellcheckingLanguages = []; 126 const spellcheckingLanguages = getSelectOptions({
128 Object.keys(SPELLCHECKER_LOCALES).sort(Intl.Collator().compare).forEach((key) => { 127 locales: SPELLCHECKER_LOCALES,
129 spellcheckingLanguages.push({
130 value: key,
131 label: SPELLCHECKER_LOCALES[key],
132 });
133 }); 128 });
134 129
135 const config = { 130 const config = {
@@ -222,20 +217,22 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
222 const form = this.prepareForm(); 217 const form = this.prepareForm();
223 218
224 return ( 219 return (
225 <EditSettingsForm 220 <ErrorBoundary>
226 form={form} 221 <EditSettingsForm
227 checkForUpdates={checkForUpdates} 222 form={form}
228 installUpdate={installUpdate} 223 checkForUpdates={checkForUpdates}
229 isCheckingForUpdates={updateStatus === updateStatusTypes.CHECKING} 224 installUpdate={installUpdate}
230 isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE} 225 isCheckingForUpdates={updateStatus === updateStatusTypes.CHECKING}
231 noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} 226 isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE}
232 updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} 227 noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE}
233 onSubmit={d => this.onSubmit(d)} 228 updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED}
234 cacheSize={cacheSize} 229 onSubmit={d => this.onSubmit(d)}
235 isClearingAllCache={isClearingAllCache} 230 cacheSize={cacheSize}
236 onClearAllCache={clearAllCache} 231 isClearingAllCache={isClearingAllCache}
237 isSpellcheckerPremiumFeature={spellcheckerConfig.isPremiumFeature} 232 onClearAllCache={clearAllCache}
238 /> 233 isSpellcheckerPremiumFeature={spellcheckerConfig.isPremiumFeature}
234 />
235 </ErrorBoundary>
239 ); 236 );
240 } 237 }
241} 238}