aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.ts23
-rw-r--r--src/containers/settings/EditServiceScreen.js5
-rw-r--r--src/containers/settings/EditSettingsScreen.js4
-rw-r--r--src/models/Recipe.ts33
-rw-r--r--src/stores/ServicesStore.js20
5 files changed, 47 insertions, 38 deletions
diff --git a/src/config.ts b/src/config.ts
index 5f95a59f4..dfedbe6f5 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -235,4 +235,27 @@ export const DEFAULT_APP_SETTINGS = {
235 alwaysShowWorkspaces: false, 235 alwaysShowWorkspaces: false,
236 liftSingleInstanceLock: false, 236 liftSingleInstanceLock: false,
237 enableLongPressServiceHint: false, 237 enableLongPressServiceHint: false,
238 proxyFeatureEnabled: false,
239 onlyShowFavoritesInUnreadCount: false
240};
241
242export const DEFAULT_SERVICE_SETTINGS = {
243 isEnabled: true,
244 isHibernationEnabled: false,
245 isWakeUpEnabled: true,
246 isNotificationEnabled: true,
247 isBadgeEnabled: true,
248 isMuted: false,
249 customIcon: false,
250 isDarkModeEnabled: false,
251 // Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done
252 hasDirectMessages: true,
253 hasIndirectMessages: false,
254 hasNotificationSound: false,
255 hasTeamId: false,
256 hasCustomUrl: false,
257 hasHostedOption: false,
258 allowFavoritesDelineationInUnreadCount: false,
259 disablewebsecurity: false,
260 autoHibernate: false,
238}; 261};
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index 972d3d251..43b461670 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -23,6 +23,7 @@ import { config as proxyFeature } from '../../features/serviceProxy';
23import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; 23import { SPELLCHECKER_LOCALES } from '../../i18n/languages';
24 24
25import globalMessages from '../../i18n/globalMessages'; 25import globalMessages from '../../i18n/globalMessages';
26import { DEFAULT_APP_SETTINGS } from '../../config';
26 27
27const messages = defineMessages({ 28const messages = defineMessages({
28 name: { 29 name: {
@@ -307,7 +308,7 @@ class EditServiceScreen extends Component {
307 onlyShowFavoritesInUnreadCount: { 308 onlyShowFavoritesInUnreadCount: {
308 label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount), 309 label: intl.formatMessage(messages.onlyShowFavoritesInUnreadCount),
309 value: service.onlyShowFavoritesInUnreadCount, 310 value: service.onlyShowFavoritesInUnreadCount,
310 default: false, 311 default: DEFAULT_APP_SETTINGS.onlyShowFavoritesInUnreadCount,
311 }, 312 },
312 }); 313 });
313 } 314 }
@@ -323,7 +324,7 @@ class EditServiceScreen extends Component {
323 isEnabled: { 324 isEnabled: {
324 label: intl.formatMessage(messages.enableProxy), 325 label: intl.formatMessage(messages.enableProxy),
325 value: serviceProxyConfig.isEnabled, 326 value: serviceProxyConfig.isEnabled,
326 default: false, 327 default: DEFAULT_APP_SETTINGS.proxyFeatureEnabled,
327 }, 328 },
328 host: { 329 host: {
329 label: intl.formatMessage(messages.proxyHost), 330 label: intl.formatMessage(messages.proxyHost),
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index aea077a1e..de0714870 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -517,7 +517,7 @@ class EditSettingsScreen extends Component {
517 lockingFeatureEnabled: { 517 lockingFeatureEnabled: {
518 label: intl.formatMessage(messages.enableLock), 518 label: intl.formatMessage(messages.enableLock),
519 value: settings.all.app.lockingFeatureEnabled || false, 519 value: settings.all.app.lockingFeatureEnabled || false,
520 default: false, 520 default: DEFAULT_APP_SETTINGS.lockingFeatureEnabled,
521 }, 521 },
522 lockedPassword: { 522 lockedPassword: {
523 label: intl.formatMessage(messages.lockPassword), 523 label: intl.formatMessage(messages.lockPassword),
@@ -539,7 +539,7 @@ class EditSettingsScreen extends Component {
539 scheduledDNDEnabled: { 539 scheduledDNDEnabled: {
540 label: intl.formatMessage(messages.scheduledDNDEnabled), 540 label: intl.formatMessage(messages.scheduledDNDEnabled),
541 value: settings.all.app.scheduledDNDEnabled || false, 541 value: settings.all.app.scheduledDNDEnabled || false,
542 default: false, 542 default: DEFAULT_APP_SETTINGS.scheduledDNDEnabled,
543 }, 543 },
544 scheduledDNDStart: { 544 scheduledDNDStart: {
545 label: intl.formatMessage(messages.scheduledDNDStart), 545 label: intl.formatMessage(messages.scheduledDNDStart),
diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts
index e45977f24..e3efb2c4b 100644
--- a/src/models/Recipe.ts
+++ b/src/models/Recipe.ts
@@ -1,6 +1,7 @@
1import semver from 'semver'; 1import semver from 'semver';
2import { pathExistsSync } from 'fs-extra'; 2import { pathExistsSync } from 'fs-extra';
3import { join } from 'path'; 3import { join } from 'path';
4import { DEFAULT_SERVICE_SETTINGS } from 'src/config';
4import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils'; 5import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils';
5 6
6interface IRecipe { 7interface IRecipe {
@@ -27,20 +28,6 @@ interface IRecipe {
27 }; 28 };
28} 29}
29 30
30// Note: Do NOT change these default values. If they change, then the corresponding changes in the recipes needs to be done
31// TODO: Need to reconcile other properties
32const DEFAULT_RECIPE_SETTINGS = {
33 hasDirectMessages: true,
34 hasIndirectMessages: false,
35 hasNotificationSound: false,
36 hasTeamId: false,
37 hasCustomUrl: false,
38 hasHostedOption: false,
39 allowFavoritesDelineationInUnreadCount: false,
40 disablewebsecurity: false,
41 autoHibernate: false,
42};
43
44export default class Recipe { 31export default class Recipe {
45 id: string = ''; 32 id: string = '';
46 33
@@ -54,17 +41,17 @@ export default class Recipe {
54 41
55 serviceURL: string = ''; 42 serviceURL: string = '';
56 43
57 hasDirectMessages: boolean = DEFAULT_RECIPE_SETTINGS.hasDirectMessages; 44 hasDirectMessages: boolean = DEFAULT_SERVICE_SETTINGS.hasDirectMessages;
58 45
59 hasIndirectMessages: boolean = DEFAULT_RECIPE_SETTINGS.hasIndirectMessages; 46 hasIndirectMessages: boolean = DEFAULT_SERVICE_SETTINGS.hasIndirectMessages;
60 47
61 hasNotificationSound: boolean = DEFAULT_RECIPE_SETTINGS.hasNotificationSound; 48 hasNotificationSound: boolean = DEFAULT_SERVICE_SETTINGS.hasNotificationSound;
62 49
63 hasTeamId: boolean = DEFAULT_RECIPE_SETTINGS.hasTeamId; 50 hasTeamId: boolean = DEFAULT_SERVICE_SETTINGS.hasTeamId;
64 51
65 hasCustomUrl: boolean = DEFAULT_RECIPE_SETTINGS.hasCustomUrl; 52 hasCustomUrl: boolean = DEFAULT_SERVICE_SETTINGS.hasCustomUrl;
66 53
67 hasHostedOption: boolean = DEFAULT_RECIPE_SETTINGS.hasHostedOption; 54 hasHostedOption: boolean = DEFAULT_SERVICE_SETTINGS.hasHostedOption;
68 55
69 urlInputPrefix: string = ''; 56 urlInputPrefix: string = '';
70 57
@@ -73,12 +60,12 @@ export default class Recipe {
73 message: string = ''; 60 message: string = '';
74 61
75 allowFavoritesDelineationInUnreadCount: boolean = 62 allowFavoritesDelineationInUnreadCount: boolean =
76 DEFAULT_RECIPE_SETTINGS.allowFavoritesDelineationInUnreadCount; 63 DEFAULT_SERVICE_SETTINGS.allowFavoritesDelineationInUnreadCount;
77 64
78 disablewebsecurity: boolean = DEFAULT_RECIPE_SETTINGS.disablewebsecurity; 65 disablewebsecurity: boolean = DEFAULT_SERVICE_SETTINGS.disablewebsecurity;
79 66
80 // TODO: Is this even used? 67 // TODO: Is this even used?
81 autoHibernate: boolean = DEFAULT_RECIPE_SETTINGS.autoHibernate; 68 autoHibernate: boolean = DEFAULT_SERVICE_SETTINGS.autoHibernate;
82 69
83 path: string = ''; 70 path: string = '';
84 71
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index c6baa4358..4f7ad7442 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -15,7 +15,7 @@ import {
15 getDevRecipeDirectory, 15 getDevRecipeDirectory,
16} from '../helpers/recipe-helpers'; 16} from '../helpers/recipe-helpers';
17import { workspaceStore } from '../features/workspaces'; 17import { workspaceStore } from '../features/workspaces';
18import { KEEP_WS_LOADED_USID } from '../config'; 18import { DEFAULT_SERVICE_SETTINGS, KEEP_WS_LOADED_USID } from '../config';
19import { SPELLCHECKER_LOCALES } from '../i18n/languages'; 19import { SPELLCHECKER_LOCALES } from '../i18n/languages';
20import { ferdiVersion } from '../environment-remote'; 20import { ferdiVersion } from '../environment-remote';
21 21
@@ -395,17 +395,15 @@ export default class ServicesStore extends Store {
395 } 395 }
396 396
397 // set default values for serviceData 397 // set default values for serviceData
398
399 // TODO: How is this different from the defaults of the recipe in 'src/models/Recipe' file?
400 serviceData = { 398 serviceData = {
401 isEnabled: true, 399 isEnabled: DEFAULT_SERVICE_SETTINGS.isEnabled,
402 isHibernationEnabled: false, 400 isHibernationEnabled: DEFAULT_SERVICE_SETTINGS.isHibernationEnabled,
403 isWakeUpEnabled: true, 401 isWakeUpEnabled: DEFAULT_SERVICE_SETTINGS.isWakeUpEnabled,
404 isNotificationEnabled: true, 402 isNotificationEnabled: DEFAULT_SERVICE_SETTINGS.isNotificationEnabled,
405 isBadgeEnabled: true, 403 isBadgeEnabled: DEFAULT_SERVICE_SETTINGS.isBadgeEnabled,
406 isMuted: false, 404 isMuted: DEFAULT_SERVICE_SETTINGS.isMuted,
407 customIcon: false, 405 customIcon: DEFAULT_SERVICE_SETTINGS.customIcon,
408 isDarkModeEnabled: false, 406 isDarkModeEnabled: DEFAULT_SERVICE_SETTINGS.isDarkModeEnabled,
409 spellcheckerLanguage: 407 spellcheckerLanguage:
410 SPELLCHECKER_LOCALES[this.stores.settings.app.spellcheckerLanguage], 408 SPELLCHECKER_LOCALES[this.stores.settings.app.spellcheckerLanguage],
411 userAgentPref: '', 409 userAgentPref: '',