aboutsummaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-16 21:43:20 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2021-10-16 21:43:20 +0530
commit19ef0c756eba1b6c554ce9892f503534e2bf0597 (patch)
tree3eeb4b631805a39f00ab58a0995c0003df467007 /src/models
parentregenerate i18n file (diff)
downloadferdium-app-19ef0c756eba1b6c554ce9892f503534e2bf0597.tar.gz
ferdium-app-19ef0c756eba1b6c554ce9892f503534e2bf0597.tar.zst
ferdium-app-19ef0c756eba1b6c554ce9892f503534e2bf0597.zip
refactor: move service-defaults into the 'config' file for reuse
Diffstat (limited to 'src/models')
-rw-r--r--src/models/Recipe.ts33
1 files changed, 10 insertions, 23 deletions
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