diff options
Diffstat (limited to 'src/containers/settings/EditSettingsScreen.js')
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 166 |
1 files changed, 89 insertions, 77 deletions
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 09244bc3c..8834aa1ae 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, injectIntl } from 'react-intl'; |
5 | 5 | ||
6 | import AppStore from '../../stores/AppStore'; | 6 | import AppStore from '../../stores/AppStore'; |
7 | import SettingsStore from '../../stores/SettingsStore'; | 7 | import SettingsStore from '../../stores/SettingsStore'; |
@@ -10,8 +10,15 @@ import TodosStore from '../../features/todos/store'; | |||
10 | import Form from '../../lib/Form'; | 10 | import Form from '../../lib/Form'; |
11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 11 | import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
12 | import { | 12 | import { |
13 | HIBERNATION_STRATEGIES, SIDEBAR_WIDTH, ICON_SIZES, NAVIGATION_BAR_BEHAVIOURS, SEARCH_ENGINE_NAMES, TODO_APPS, | 13 | HIBERNATION_STRATEGIES, |
14 | DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, DEFAULT_IS_FEATURE_ENABLED_BY_USER, WAKE_UP_STRATEGIES, | 14 | SIDEBAR_WIDTH, |
15 | ICON_SIZES, | ||
16 | NAVIGATION_BAR_BEHAVIOURS, | ||
17 | SEARCH_ENGINE_NAMES, | ||
18 | TODO_APPS, | ||
19 | DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED, | ||
20 | DEFAULT_IS_FEATURE_ENABLED_BY_USER, | ||
21 | WAKE_UP_STRATEGIES, | ||
15 | } from '../../config'; | 22 | } from '../../config'; |
16 | import { DEFAULT_APP_SETTINGS, isMac } from '../../environment'; | 23 | import { DEFAULT_APP_SETTINGS, isMac } from '../../environment'; |
17 | 24 | ||
@@ -31,195 +38,193 @@ const debug = require('debug')('Ferdi:EditSettingsScreen'); | |||
31 | const messages = defineMessages({ | 38 | const messages = defineMessages({ |
32 | autoLaunchOnStart: { | 39 | autoLaunchOnStart: { |
33 | id: 'settings.app.form.autoLaunchOnStart', | 40 | id: 'settings.app.form.autoLaunchOnStart', |
34 | defaultMessage: '!!!Launch Ferdi on start', | 41 | defaultMessage: 'Launch Ferdi on start', |
35 | }, | 42 | }, |
36 | autoLaunchInBackground: { | 43 | autoLaunchInBackground: { |
37 | id: 'settings.app.form.autoLaunchInBackground', | 44 | id: 'settings.app.form.autoLaunchInBackground', |
38 | defaultMessage: '!!!Open in background', | 45 | defaultMessage: 'Open in background', |
39 | }, | 46 | }, |
40 | runInBackground: { | 47 | runInBackground: { |
41 | id: 'settings.app.form.runInBackground', | 48 | id: 'settings.app.form.runInBackground', |
42 | defaultMessage: '!!!Keep Ferdi in background when closing the window', | 49 | defaultMessage: 'Keep Ferdi in background when closing the window', |
43 | }, | 50 | }, |
44 | startMinimized: { | 51 | startMinimized: { |
45 | id: 'settings.app.form.startMinimized', | 52 | id: 'settings.app.form.startMinimized', |
46 | defaultMessage: '!!!Start minimized', | 53 | defaultMessage: 'Start minimized', |
47 | }, | 54 | }, |
48 | confirmOnQuit: { | 55 | confirmOnQuit: { |
49 | id: 'settings.app.form.confirmOnQuit', | 56 | id: 'settings.app.form.confirmOnQuit', |
50 | defaultMessage: '!!!Confirm when quitting Ferdi', | 57 | defaultMessage: 'Confirm when quitting Ferdi', |
51 | }, | 58 | }, |
52 | enableSystemTray: { | 59 | enableSystemTray: { |
53 | id: 'settings.app.form.enableSystemTray', | 60 | id: 'settings.app.form.enableSystemTray', |
54 | defaultMessage: '!!!Always show Ferdi in System Tray', | 61 | defaultMessage: 'Always show Ferdi in System Tray', |
55 | }, | 62 | }, |
56 | enableMenuBar: { | 63 | enableMenuBar: { |
57 | id: 'settings.app.form.enableMenuBar', | 64 | id: 'settings.app.form.enableMenuBar', |
58 | defaultMessage: '!!!Always show Ferdi in Menu Bar', | 65 | defaultMessage: 'Always show Ferdi in Menu Bar', |
59 | }, | 66 | }, |
60 | reloadAfterResume: { | 67 | reloadAfterResume: { |
61 | id: 'settings.app.form.reloadAfterResume', | 68 | id: 'settings.app.form.reloadAfterResume', |
62 | defaultMessage: '!!!Reload Ferdi after system resume', | 69 | defaultMessage: 'Reload Ferdi after system resume', |
63 | }, | 70 | }, |
64 | minimizeToSystemTray: { | 71 | minimizeToSystemTray: { |
65 | id: 'settings.app.form.minimizeToSystemTray', | 72 | id: 'settings.app.form.minimizeToSystemTray', |
66 | defaultMessage: '!!!Minimize Ferdi to system tray', | 73 | defaultMessage: 'Minimize Ferdi to system tray', |
67 | }, | 74 | }, |
68 | closeToSystemTray: { | 75 | closeToSystemTray: { |
69 | id: 'settings.app.form.closeToSystemTray', | 76 | id: 'settings.app.form.closeToSystemTray', |
70 | defaultMessage: '!!!Close Ferdi to system tray', | 77 | defaultMessage: 'Close Ferdi to system tray', |
71 | }, | 78 | }, |
72 | privateNotifications: { | 79 | privateNotifications: { |
73 | id: 'settings.app.form.privateNotifications', | 80 | id: 'settings.app.form.privateNotifications', |
74 | defaultMessage: '!!!Don\'t show message content in notifications', | 81 | defaultMessage: "Don't show message content in notifications", |
75 | }, | 82 | }, |
76 | clipboardNotifications: { | 83 | clipboardNotifications: { |
77 | id: 'settings.app.form.clipboardNotifications', | 84 | id: 'settings.app.form.clipboardNotifications', |
78 | defaultMessage: '!!!Don\'t show notifications for clipboard events', | 85 | defaultMessage: "Don't show notifications for clipboard events", |
79 | }, | 86 | }, |
80 | notifyTaskBarOnMessage: { | 87 | notifyTaskBarOnMessage: { |
81 | id: 'settings.app.form.notifyTaskBarOnMessage', | 88 | id: 'settings.app.form.notifyTaskBarOnMessage', |
82 | defaultMessage: '!!!Notify TaskBar/Dock on new message', | 89 | defaultMessage: 'Notify TaskBar/Dock on new message', |
83 | }, | 90 | }, |
84 | navigationBarBehaviour: { | 91 | navigationBarBehaviour: { |
85 | id: 'settings.app.form.navigationBarBehaviour', | 92 | id: 'settings.app.form.navigationBarBehaviour', |
86 | defaultMessage: '!!!Navigation bar behaviour', | 93 | defaultMessage: 'Navigation bar behaviour', |
87 | }, | 94 | }, |
88 | searchEngine: { | 95 | searchEngine: { |
89 | id: 'settings.app.form.searchEngine', | 96 | id: 'settings.app.form.searchEngine', |
90 | defaultMessage: '!!!Search engine', | 97 | defaultMessage: 'Search engine', |
91 | }, | 98 | }, |
92 | sentry: { | 99 | sentry: { |
93 | id: 'settings.app.form.sentry', | 100 | id: 'settings.app.form.sentry', |
94 | defaultMessage: '!!!Send telemetry data', | 101 | defaultMessage: 'Send telemetry data', |
95 | }, | 102 | }, |
96 | hibernateOnStartup: { | 103 | hibernateOnStartup: { |
97 | id: 'settings.app.form.hibernateOnStartup', | 104 | id: 'settings.app.form.hibernateOnStartup', |
98 | defaultMessage: '!!!Keep services in hibernation on startup', | 105 | defaultMessage: 'Keep services in hibernation on startup', |
99 | }, | 106 | }, |
100 | hibernationStrategy: { | 107 | hibernationStrategy: { |
101 | id: 'settings.app.form.hibernationStrategy', | 108 | id: 'settings.app.form.hibernationStrategy', |
102 | defaultMessage: '!!!Hibernation strategy', | 109 | defaultMessage: 'Hibernation strategy', |
103 | }, | 110 | }, |
104 | wakeUpStrategy: { | 111 | wakeUpStrategy: { |
105 | id: 'settings.app.form.wakeUpStrategy', | 112 | id: 'settings.app.form.wakeUpStrategy', |
106 | defaultMessage: '!!!Wake up strategy', | 113 | defaultMessage: 'Wake up strategy', |
107 | }, | 114 | }, |
108 | predefinedTodoServer: { | 115 | predefinedTodoServer: { |
109 | id: 'settings.app.form.predefinedTodoServer', | 116 | id: 'settings.app.form.predefinedTodoServer', |
110 | defaultMessage: '!!!Todo Server', | 117 | defaultMessage: 'Todo Server', |
111 | }, | 118 | }, |
112 | customTodoServer: { | 119 | customTodoServer: { |
113 | id: 'settings.app.form.customTodoServer', | 120 | id: 'settings.app.form.customTodoServer', |
114 | defaultMessage: '!!!Custom TodoServer', | 121 | defaultMessage: 'Custom TodoServer', |
115 | }, | 122 | }, |
116 | enableLock: { | 123 | enableLock: { |
117 | id: 'settings.app.form.enableLock', | 124 | id: 'settings.app.form.enableLock', |
118 | defaultMessage: '!!!Enable Password Lock', | 125 | defaultMessage: 'Enable Password Lock', |
119 | }, | 126 | }, |
120 | lockPassword: { | 127 | lockPassword: { |
121 | id: 'settings.app.form.lockPassword', | 128 | id: 'settings.app.form.lockPassword', |
122 | defaultMessage: '!!!Password', | 129 | defaultMessage: 'Password', |
123 | }, | 130 | }, |
124 | useTouchIdToUnlock: { | 131 | useTouchIdToUnlock: { |
125 | id: 'settings.app.form.useTouchIdToUnlock', | 132 | id: 'settings.app.form.useTouchIdToUnlock', |
126 | defaultMessage: '!!!Allow using Touch ID to unlock', | 133 | defaultMessage: 'Allow using Touch ID to unlock', |
127 | }, | 134 | }, |
128 | inactivityLock: { | 135 | inactivityLock: { |
129 | id: 'settings.app.form.inactivityLock', | 136 | id: 'settings.app.form.inactivityLock', |
130 | defaultMessage: '!!!Lock after inactivity', | 137 | defaultMessage: 'Lock after inactivity', |
131 | }, | 138 | }, |
132 | scheduledDNDEnabled: { | 139 | scheduledDNDEnabled: { |
133 | id: 'settings.app.form.scheduledDNDEnabled', | 140 | id: 'settings.app.form.scheduledDNDEnabled', |
134 | defaultMessage: '!!!Enable scheduled Do-not-Disturb', | 141 | defaultMessage: 'Enable scheduled Do-not-Disturb', |
135 | }, | 142 | }, |
136 | scheduledDNDStart: { | 143 | scheduledDNDStart: { |
137 | id: 'settings.app.form.scheduledDNDStart', | 144 | id: 'settings.app.form.scheduledDNDStart', |
138 | defaultMessage: '!!!From', | 145 | defaultMessage: 'From', |
139 | }, | 146 | }, |
140 | scheduledDNDEnd: { | 147 | scheduledDNDEnd: { |
141 | id: 'settings.app.form.scheduledDNDEnd', | 148 | id: 'settings.app.form.scheduledDNDEnd', |
142 | defaultMessage: '!!!To', | 149 | defaultMessage: 'To', |
143 | }, | 150 | }, |
144 | language: { | 151 | language: { |
145 | id: 'settings.app.form.language', | 152 | id: 'settings.app.form.language', |
146 | defaultMessage: '!!!Language', | 153 | defaultMessage: 'Language', |
147 | }, | 154 | }, |
148 | darkMode: { | 155 | darkMode: { |
149 | id: 'settings.app.form.darkMode', | 156 | id: 'settings.app.form.darkMode', |
150 | defaultMessage: '!!!Dark Mode', | 157 | defaultMessage: 'Dark Mode', |
151 | }, | 158 | }, |
152 | adaptableDarkMode: { | 159 | adaptableDarkMode: { |
153 | id: 'settings.app.form.adaptableDarkMode', | 160 | id: 'settings.app.form.adaptableDarkMode', |
154 | defaultMessage: '!!!Synchronize dark mode with my OS\'s dark mode setting', | 161 | defaultMessage: "Synchronize dark mode with my OS's dark mode setting", |
155 | }, | 162 | }, |
156 | universalDarkMode: { | 163 | universalDarkMode: { |
157 | id: 'settings.app.form.universalDarkMode', | 164 | id: 'settings.app.form.universalDarkMode', |
158 | defaultMessage: '!!!Enable universal Dark Mode', | 165 | defaultMessage: 'Enable universal Dark Mode', |
159 | }, | 166 | }, |
160 | serviceRibbonWidth: { | 167 | serviceRibbonWidth: { |
161 | id: 'settings.app.form.serviceRibbonWidth', | 168 | id: 'settings.app.form.serviceRibbonWidth', |
162 | defaultMessage: '!!!Sidebar width', | 169 | defaultMessage: 'Sidebar width', |
163 | }, | 170 | }, |
164 | iconSize: { | 171 | iconSize: { |
165 | id: 'settings.app.form.iconSize', | 172 | id: 'settings.app.form.iconSize', |
166 | defaultMessage: '!!!Service icon size', | 173 | defaultMessage: 'Service icon size', |
167 | }, | 174 | }, |
168 | useVerticalStyle: { | 175 | useVerticalStyle: { |
169 | id: 'settings.app.form.useVerticalStyle', | 176 | id: 'settings.app.form.useVerticalStyle', |
170 | defaultMessage: '!!!Use horizontal style', | 177 | defaultMessage: 'Use horizontal style', |
171 | }, | 178 | }, |
172 | alwaysShowWorkspaces: { | 179 | alwaysShowWorkspaces: { |
173 | id: 'settings.app.form.alwaysShowWorkspaces', | 180 | id: 'settings.app.form.alwaysShowWorkspaces', |
174 | defaultMessage: '!!!Always show workspace drawer', | 181 | defaultMessage: 'Always show workspace drawer', |
175 | }, | 182 | }, |
176 | accentColor: { | 183 | accentColor: { |
177 | id: 'settings.app.form.accentColor', | 184 | id: 'settings.app.form.accentColor', |
178 | defaultMessage: '!!!Accent color', | 185 | defaultMessage: 'Accent color', |
179 | }, | 186 | }, |
180 | showDisabledServices: { | 187 | showDisabledServices: { |
181 | id: 'settings.app.form.showDisabledServices', | 188 | id: 'settings.app.form.showDisabledServices', |
182 | defaultMessage: '!!!Display disabled services tabs', | 189 | defaultMessage: 'Display disabled services tabs', |
183 | }, | 190 | }, |
184 | showMessageBadgeWhenMuted: { | 191 | showMessageBadgeWhenMuted: { |
185 | id: 'settings.app.form.showMessagesBadgesWhenMuted', | 192 | id: 'settings.app.form.showMessagesBadgesWhenMuted', |
186 | defaultMessage: '!!!Show unread message badge when notifications are disabled', | 193 | defaultMessage: 'Show unread message badge when notifications are disabled', |
187 | }, | 194 | }, |
188 | showDragArea: { | 195 | showDragArea: { |
189 | id: 'settings.app.form.showDragArea', | 196 | id: 'settings.app.form.showDragArea', |
190 | defaultMessage: '!!!Show draggable area on window', | 197 | defaultMessage: 'Show draggable area on window', |
191 | }, | 198 | }, |
192 | enableSpellchecking: { | 199 | enableSpellchecking: { |
193 | id: 'settings.app.form.enableSpellchecking', | 200 | id: 'settings.app.form.enableSpellchecking', |
194 | defaultMessage: '!!!Enable spell checking', | 201 | defaultMessage: 'Enable spell checking', |
195 | }, | 202 | }, |
196 | enableGPUAcceleration: { | 203 | enableGPUAcceleration: { |
197 | id: 'settings.app.form.enableGPUAcceleration', | 204 | id: 'settings.app.form.enableGPUAcceleration', |
198 | defaultMessage: '!!!Enable GPU Acceleration', | 205 | defaultMessage: 'Enable GPU Acceleration', |
199 | }, | 206 | }, |
200 | beta: { | 207 | beta: { |
201 | id: 'settings.app.form.beta', | 208 | id: 'settings.app.form.beta', |
202 | defaultMessage: '!!!Include beta versions', | 209 | defaultMessage: 'Include beta versions', |
203 | }, | 210 | }, |
204 | automaticUpdates: { | 211 | automaticUpdates: { |
205 | id: 'settings.app.form.automaticUpdates', | 212 | id: 'settings.app.form.automaticUpdates', |
206 | defaultMessage: '!!!Enable updates', | 213 | defaultMessage: 'Enable updates', |
207 | }, | 214 | }, |
208 | enableTodos: { | 215 | enableTodos: { |
209 | id: 'settings.app.form.enableTodos', | 216 | id: 'settings.app.form.enableTodos', |
210 | defaultMessage: '!!!Enable Franz Todos', | 217 | defaultMessage: 'Enable Franz Todos', |
211 | }, | 218 | }, |
212 | keepAllWorkspacesLoaded: { | 219 | keepAllWorkspacesLoaded: { |
213 | id: 'settings.app.form.keepAllWorkspacesLoaded', | 220 | id: 'settings.app.form.keepAllWorkspacesLoaded', |
214 | defaultMessage: '!!!Keep all workspaces loaded', | 221 | defaultMessage: 'Keep all workspaces loaded', |
215 | }, | 222 | }, |
216 | }); | 223 | }); |
217 | 224 | ||
218 | export default @inject('stores', 'actions') @observer class EditSettingsScreen extends Component { | 225 | @inject('stores', 'actions') |
219 | static contextTypes = { | 226 | @observer |
220 | intl: intlShape, | 227 | class EditSettingsScreen extends Component { |
221 | }; | ||
222 | |||
223 | constructor(props) { | 228 | constructor(props) { |
224 | super(props); | 229 | super(props); |
225 | 230 | ||
@@ -288,7 +293,9 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
288 | useVerticalStyle: Boolean(settingsData.useVerticalStyle), | 293 | useVerticalStyle: Boolean(settingsData.useVerticalStyle), |
289 | alwaysShowWorkspaces: Boolean(settingsData.alwaysShowWorkspaces), | 294 | alwaysShowWorkspaces: Boolean(settingsData.alwaysShowWorkspaces), |
290 | accentColor: settingsData.accentColor, | 295 | accentColor: settingsData.accentColor, |
291 | showMessageBadgeWhenMuted: Boolean(settingsData.showMessageBadgeWhenMuted), | 296 | showMessageBadgeWhenMuted: Boolean( |
297 | settingsData.showMessageBadgeWhenMuted, | ||
298 | ), | ||
292 | showDragArea: Boolean(settingsData.showDragArea), | 299 | showDragArea: Boolean(settingsData.showDragArea), |
293 | enableSpellchecking: Boolean(settingsData.enableSpellchecking), | 300 | enableSpellchecking: Boolean(settingsData.enableSpellchecking), |
294 | spellcheckerLanguage: settingsData.spellcheckerLanguage, | 301 | spellcheckerLanguage: settingsData.spellcheckerLanguage, |
@@ -309,24 +316,27 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
309 | 316 | ||
310 | if (workspaces.isFeatureActive) { | 317 | if (workspaces.isFeatureActive) { |
311 | const { keepAllWorkspacesLoaded } = workspaces.settings; | 318 | const { keepAllWorkspacesLoaded } = workspaces.settings; |
312 | if (Boolean(keepAllWorkspacesLoaded) !== Boolean(settingsData.keepAllWorkspacesLoaded)) { | 319 | if ( |
320 | Boolean(keepAllWorkspacesLoaded) !== | ||
321 | Boolean(settingsData.keepAllWorkspacesLoaded) | ||
322 | ) { | ||
313 | workspaceActions.toggleKeepAllWorkspacesLoadedSetting(); | 323 | workspaceActions.toggleKeepAllWorkspacesLoadedSetting(); |
314 | } | 324 | } |
315 | } | 325 | } |
316 | 326 | ||
317 | if (todos.isFeatureActive) { | 327 | if (todos.isFeatureActive) { |
318 | const { isFeatureEnabledByUser } = todos.settings; | 328 | const { isFeatureEnabledByUser } = todos.settings; |
319 | if (Boolean(isFeatureEnabledByUser) !== Boolean(settingsData.enableTodos)) { | 329 | if ( |
330 | Boolean(isFeatureEnabledByUser) !== Boolean(settingsData.enableTodos) | ||
331 | ) { | ||
320 | todosActions.toggleTodosFeatureVisibility(); | 332 | todosActions.toggleTodosFeatureVisibility(); |
321 | } | 333 | } |
322 | } | 334 | } |
323 | } | 335 | } |
324 | 336 | ||
325 | prepareForm() { | 337 | prepareForm() { |
326 | const { | 338 | const { app, settings, user, todos, workspaces } = this.props.stores; |
327 | app, settings, user, todos, workspaces, | 339 | const { intl } = this.props; |
328 | } = this.props.stores; | ||
329 | const { intl } = this.context; | ||
330 | const { lockedPassword } = this.state; | 340 | const { lockedPassword } = this.state; |
331 | 341 | ||
332 | const locales = getSelectOptions({ | 342 | const locales = getSelectOptions({ |
@@ -370,7 +380,9 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
370 | 380 | ||
371 | const spellcheckingLanguages = getSelectOptions({ | 381 | const spellcheckingLanguages = getSelectOptions({ |
372 | locales: SPELLCHECKER_LOCALES, | 382 | locales: SPELLCHECKER_LOCALES, |
373 | automaticDetectionText: this.context.intl.formatMessage(globalMessages.spellcheckerAutomaticDetection), | 383 | automaticDetectionText: intl.formatMessage( |
384 | globalMessages.spellcheckerAutomaticDetection, | ||
385 | ), | ||
374 | }); | 386 | }); |
375 | 387 | ||
376 | const config = { | 388 | const config = { |
@@ -401,7 +413,9 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
401 | default: DEFAULT_APP_SETTINGS.confirmOnQuit, | 413 | default: DEFAULT_APP_SETTINGS.confirmOnQuit, |
402 | }, | 414 | }, |
403 | enableSystemTray: { | 415 | enableSystemTray: { |
404 | label: intl.formatMessage(isMac ? messages.enableMenuBar : messages.enableSystemTray), | 416 | label: intl.formatMessage( |
417 | isMac ? messages.enableMenuBar : messages.enableSystemTray, | ||
418 | ), | ||
405 | value: settings.all.app.enableSystemTray, | 419 | value: settings.all.app.enableSystemTray, |
406 | default: DEFAULT_APP_SETTINGS.enableSystemTray, | 420 | default: DEFAULT_APP_SETTINGS.enableSystemTray, |
407 | }, | 421 | }, |
@@ -637,23 +651,15 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
637 | } | 651 | } |
638 | 652 | ||
639 | render() { | 653 | render() { |
640 | const { | 654 | const { app, todos, workspaces, services } = this.props.stores; |
641 | app, | ||
642 | todos, | ||
643 | workspaces, | ||
644 | services, | ||
645 | } = this.props.stores; | ||
646 | const { | 655 | const { |
647 | updateStatus, | 656 | updateStatus, |
648 | updateStatusTypes, | 657 | updateStatusTypes, |
649 | isClearingAllCache, | 658 | isClearingAllCache, |
650 | lockingFeatureEnabled, | 659 | lockingFeatureEnabled, |
651 | } = app; | 660 | } = app; |
652 | const { | 661 | const { checkForUpdates, installUpdate, clearAllCache } = |
653 | checkForUpdates, | 662 | this.props.actions.app; |
654 | installUpdate, | ||
655 | clearAllCache, | ||
656 | } = this.props.actions.app; | ||
657 | const form = this.prepareForm(); | 663 | const form = this.prepareForm(); |
658 | 664 | ||
659 | return ( | 665 | return ( |
@@ -666,7 +672,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
666 | isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE} | 672 | isUpdateAvailable={updateStatus === updateStatusTypes.AVAILABLE} |
667 | noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} | 673 | noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} |
668 | updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} | 674 | updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} |
669 | onSubmit={(d) => this.onSubmit(d)} | 675 | onSubmit={d => this.onSubmit(d)} |
670 | getCacheSize={() => app.cacheSize} | 676 | getCacheSize={() => app.cacheSize} |
671 | isClearingAllCache={isClearingAllCache} | 677 | isClearingAllCache={isClearingAllCache} |
672 | onClearAllCache={clearAllCache} | 678 | onClearAllCache={clearAllCache} |
@@ -675,9 +681,13 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
675 | lockingFeatureEnabled={lockingFeatureEnabled} | 681 | lockingFeatureEnabled={lockingFeatureEnabled} |
676 | automaticUpdates={this.props.stores.settings.app.automaticUpdates} | 682 | automaticUpdates={this.props.stores.settings.app.automaticUpdates} |
677 | isDarkmodeEnabled={this.props.stores.settings.app.darkMode} | 683 | isDarkmodeEnabled={this.props.stores.settings.app.darkMode} |
678 | isAdaptableDarkModeEnabled={this.props.stores.settings.app.adaptableDarkMode} | 684 | isAdaptableDarkModeEnabled={ |
685 | this.props.stores.settings.app.adaptableDarkMode | ||
686 | } | ||
679 | isTodosActivated={this.props.stores.todos.isFeatureEnabledByUser} | 687 | isTodosActivated={this.props.stores.todos.isFeatureEnabledByUser} |
680 | isUsingCustomTodoService={this.props.stores.todos.isUsingCustomTodoService} | 688 | isUsingCustomTodoService={ |
689 | this.props.stores.todos.isUsingCustomTodoService | ||
690 | } | ||
681 | isNightlyEnabled={this.props.stores.settings.app.nightly} | 691 | isNightlyEnabled={this.props.stores.settings.app.nightly} |
682 | hasAddedTodosAsService={services.isTodosServiceAdded} | 692 | hasAddedTodosAsService={services.isTodosServiceAdded} |
683 | isOnline={app.isOnline} | 693 | isOnline={app.isOnline} |
@@ -704,3 +714,5 @@ EditSettingsScreen.wrappedComponent.propTypes = { | |||
704 | workspaces: PropTypes.instanceOf(WorkspacesStore).isRequired, | 714 | workspaces: PropTypes.instanceOf(WorkspacesStore).isRequired, |
705 | }).isRequired, | 715 | }).isRequired, |
706 | }; | 716 | }; |
717 | |||
718 | export default injectIntl(EditSettingsScreen); | ||