diff options
author | 2022-11-28 23:19:19 +0530 | |
---|---|---|
committer | 2022-11-28 23:21:35 +0530 | |
commit | dfe04d3fd3f1d5b49c296faf7f7ea586cc7e6722 (patch) | |
tree | d616402bb7fbac94ca6027b6bc40151d482b9f98 /src/containers/settings | |
parent | fix: ensure default values are working for the all fields in all settings scr... (diff) | |
download | ferdium-app-dfe04d3fd3f1d5b49c296faf7f7ea586cc7e6722.tar.gz ferdium-app-dfe04d3fd3f1d5b49c296faf7f7ea586cc7e6722.tar.zst ferdium-app-dfe04d3fd3f1d5b49c296faf7f7ea586cc7e6722.zip |
Moved default service settings into different struct so as to de-pollute config on user's machine
Diffstat (limited to 'src/containers/settings')
-rw-r--r-- | src/containers/settings/EditServiceScreen.tsx | 36 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.tsx | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/containers/settings/EditServiceScreen.tsx b/src/containers/settings/EditServiceScreen.tsx index d02138fce..a72df5604 100644 --- a/src/containers/settings/EditServiceScreen.tsx +++ b/src/containers/settings/EditServiceScreen.tsx | |||
@@ -277,22 +277,22 @@ class EditServiceScreen extends Component<IProps> { | |||
277 | label: intl.formatMessage(messages.darkReaderBrightness), | 277 | label: intl.formatMessage(messages.darkReaderBrightness), |
278 | value: service?.darkReaderSettings | 278 | value: service?.darkReaderSettings |
279 | ? service?.darkReaderSettings.brightness | 279 | ? service?.darkReaderSettings.brightness |
280 | : DEFAULT_APP_SETTINGS.darkReaderBrightness, | 280 | : DEFAULT_SERVICE_SETTINGS.darkReaderBrightness, |
281 | default: DEFAULT_APP_SETTINGS.darkReaderBrightness, | 281 | default: DEFAULT_SERVICE_SETTINGS.darkReaderBrightness, |
282 | }, | 282 | }, |
283 | darkReaderContrast: { | 283 | darkReaderContrast: { |
284 | label: intl.formatMessage(messages.darkReaderContrast), | 284 | label: intl.formatMessage(messages.darkReaderContrast), |
285 | value: service?.darkReaderSettings | 285 | value: service?.darkReaderSettings |
286 | ? service?.darkReaderSettings.contrast | 286 | ? service?.darkReaderSettings.contrast |
287 | : DEFAULT_APP_SETTINGS.darkReaderContrast, | 287 | : DEFAULT_SERVICE_SETTINGS.darkReaderContrast, |
288 | default: DEFAULT_APP_SETTINGS.darkReaderContrast, | 288 | default: DEFAULT_SERVICE_SETTINGS.darkReaderContrast, |
289 | }, | 289 | }, |
290 | darkReaderSepia: { | 290 | darkReaderSepia: { |
291 | label: intl.formatMessage(messages.darkReaderSepia), | 291 | label: intl.formatMessage(messages.darkReaderSepia), |
292 | value: service?.darkReaderSettings | 292 | value: service?.darkReaderSettings |
293 | ? service?.darkReaderSettings.sepia | 293 | ? service?.darkReaderSettings.sepia |
294 | : DEFAULT_APP_SETTINGS.darkReaderSepia, | 294 | : DEFAULT_SERVICE_SETTINGS.darkReaderSepia, |
295 | default: DEFAULT_APP_SETTINGS.darkReaderSepia, | 295 | default: DEFAULT_SERVICE_SETTINGS.darkReaderSepia, |
296 | }, | 296 | }, |
297 | isProgressbarEnabled: { | 297 | isProgressbarEnabled: { |
298 | label: intl.formatMessage(messages.enableProgressbar), | 298 | label: intl.formatMessage(messages.enableProgressbar), |
@@ -380,9 +380,9 @@ class EditServiceScreen extends Component<IProps> { | |||
380 | label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount), | 380 | label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount), |
381 | value: ifUndefined<boolean>( | 381 | value: ifUndefined<boolean>( |
382 | service?.onlyShowFavoritesInUnreadCount, | 382 | service?.onlyShowFavoritesInUnreadCount, |
383 | DEFAULT_APP_SETTINGS.onlyShowFavoritesInUnreadCount, | 383 | DEFAULT_SERVICE_SETTINGS.onlyShowFavoritesInUnreadCount, |
384 | ), | 384 | ), |
385 | default: DEFAULT_APP_SETTINGS.onlyShowFavoritesInUnreadCount, | 385 | default: DEFAULT_SERVICE_SETTINGS.onlyShowFavoritesInUnreadCount, |
386 | type: 'checkbox', | 386 | type: 'checkbox', |
387 | }, | 387 | }, |
388 | }; | 388 | }; |
@@ -409,42 +409,42 @@ class EditServiceScreen extends Component<IProps> { | |||
409 | label: intl.formatMessage(messages.enableProxy), | 409 | label: intl.formatMessage(messages.enableProxy), |
410 | value: ifUndefined<boolean>( | 410 | value: ifUndefined<boolean>( |
411 | serviceProxyConfig.isEnabled, | 411 | serviceProxyConfig.isEnabled, |
412 | DEFAULT_APP_SETTINGS.proxyFeatureEnabled, | 412 | DEFAULT_SERVICE_SETTINGS.proxyFeatureEnabled, |
413 | ), | 413 | ), |
414 | default: DEFAULT_APP_SETTINGS.proxyFeatureEnabled, | 414 | default: DEFAULT_SERVICE_SETTINGS.proxyFeatureEnabled, |
415 | type: 'checkbox', | 415 | type: 'checkbox', |
416 | }, | 416 | }, |
417 | host: { | 417 | host: { |
418 | label: intl.formatMessage(messages.proxyHost), | 418 | label: intl.formatMessage(messages.proxyHost), |
419 | value: ifUndefined<string>( | 419 | value: ifUndefined<string>( |
420 | serviceProxyConfig.host, | 420 | serviceProxyConfig.host, |
421 | DEFAULT_APP_SETTINGS.proxyHost, | 421 | DEFAULT_SERVICE_SETTINGS.proxyHost, |
422 | ), | 422 | ), |
423 | default: DEFAULT_APP_SETTINGS.proxyHost, | 423 | default: DEFAULT_SERVICE_SETTINGS.proxyHost, |
424 | }, | 424 | }, |
425 | port: { | 425 | port: { |
426 | label: intl.formatMessage(messages.proxyPort), | 426 | label: intl.formatMessage(messages.proxyPort), |
427 | value: ifUndefined<number>( | 427 | value: ifUndefined<number>( |
428 | serviceProxyConfig.port, | 428 | serviceProxyConfig.port, |
429 | DEFAULT_APP_SETTINGS.proxyPort, | 429 | DEFAULT_SERVICE_SETTINGS.proxyPort, |
430 | ), | 430 | ), |
431 | default: DEFAULT_APP_SETTINGS.proxyPort, | 431 | default: DEFAULT_SERVICE_SETTINGS.proxyPort, |
432 | }, | 432 | }, |
433 | user: { | 433 | user: { |
434 | label: intl.formatMessage(messages.proxyUser), | 434 | label: intl.formatMessage(messages.proxyUser), |
435 | value: ifUndefined<string>( | 435 | value: ifUndefined<string>( |
436 | serviceProxyConfig.user, | 436 | serviceProxyConfig.user, |
437 | DEFAULT_APP_SETTINGS.proxyUser, | 437 | DEFAULT_SERVICE_SETTINGS.proxyUser, |
438 | ), | 438 | ), |
439 | default: DEFAULT_APP_SETTINGS.proxyUser, | 439 | default: DEFAULT_SERVICE_SETTINGS.proxyUser, |
440 | }, | 440 | }, |
441 | password: { | 441 | password: { |
442 | label: intl.formatMessage(messages.proxyPassword), | 442 | label: intl.formatMessage(messages.proxyPassword), |
443 | value: ifUndefined<string>( | 443 | value: ifUndefined<string>( |
444 | serviceProxyConfig.password, | 444 | serviceProxyConfig.password, |
445 | DEFAULT_APP_SETTINGS.proxyPassword, | 445 | DEFAULT_SERVICE_SETTINGS.proxyPassword, |
446 | ), | 446 | ), |
447 | default: DEFAULT_APP_SETTINGS.proxyPassword, | 447 | default: DEFAULT_SERVICE_SETTINGS.proxyPassword, |
448 | type: 'password', | 448 | type: 'password', |
449 | }, | 449 | }, |
450 | }, | 450 | }, |
diff --git a/src/containers/settings/EditSettingsScreen.tsx b/src/containers/settings/EditSettingsScreen.tsx index 5c82a7e34..fd99fd616 100644 --- a/src/containers/settings/EditSettingsScreen.tsx +++ b/src/containers/settings/EditSettingsScreen.tsx | |||
@@ -1165,9 +1165,9 @@ class EditSettingsScreen extends Component<EditSettingsScreenProps> { | |||
1165 | label: intl.formatMessage(messages.enableTodos), | 1165 | label: intl.formatMessage(messages.enableTodos), |
1166 | value: ifUndefined<boolean>( | 1166 | value: ifUndefined<boolean>( |
1167 | todos.settings.isFeatureEnabledByUser, | 1167 | todos.settings.isFeatureEnabledByUser, |
1168 | DEFAULT_APP_SETTINGS.isFeatureEnabledByUser, | 1168 | DEFAULT_APP_SETTINGS.isTodosFeatureEnabled, |
1169 | ), | 1169 | ), |
1170 | default: DEFAULT_APP_SETTINGS.isFeatureEnabledByUser, | 1170 | default: DEFAULT_APP_SETTINGS.isTodosFeatureEnabled, |
1171 | type: 'checkbox', | 1171 | type: 'checkbox', |
1172 | }; | 1172 | }; |
1173 | } | 1173 | } |