summaryrefslogtreecommitdiffstats
path: root/src/models/Service.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/Service.js')
-rw-r--r--src/models/Service.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/models/Service.js b/src/models/Service.js
index 958e4b11e..423510c7d 100644
--- a/src/models/Service.js
+++ b/src/models/Service.js
@@ -22,8 +22,10 @@ export default class Service {
22 @observable team = ''; 22 @observable team = '';
23 @observable customUrl = ''; 23 @observable customUrl = '';
24 @observable isNotificationEnabled = true; 24 @observable isNotificationEnabled = true;
25 @observable isBadgeEnabled = true;
25 @observable isIndirectMessageBadgeEnabled = true; 26 @observable isIndirectMessageBadgeEnabled = true;
26 @observable customIconUrl = ''; 27 @observable iconUrl = '';
28 @observable hasCustomUploadedIcon = false;
27 @observable hasCrashed = false; 29 @observable hasCrashed = false;
28 30
29 constructor(data, recipe) { 31 constructor(data, recipe) {
@@ -41,7 +43,8 @@ export default class Service {
41 this.name = data.name || this.name; 43 this.name = data.name || this.name;
42 this.team = data.team || this.team; 44 this.team = data.team || this.team;
43 this.customUrl = data.customUrl || this.customUrl; 45 this.customUrl = data.customUrl || this.customUrl;
44 this.customIconUrl = data.customIconUrl || this.customIconUrl; 46 // this.customIconUrl = data.customIconUrl || this.customIconUrl;
47 this.iconUrl = data.iconUrl || this.iconUrl;
45 48
46 this.order = data.order !== undefined 49 this.order = data.order !== undefined
47 ? data.order : this.order; 50 ? data.order : this.order;
@@ -52,11 +55,16 @@ export default class Service {
52 this.isNotificationEnabled = data.isNotificationEnabled !== undefined 55 this.isNotificationEnabled = data.isNotificationEnabled !== undefined
53 ? data.isNotificationEnabled : this.isNotificationEnabled; 56 ? data.isNotificationEnabled : this.isNotificationEnabled;
54 57
58 this.isBadgeEnabled = data.isBadgeEnabled !== undefined
59 ? data.isBadgeEnabled : this.isBadgeEnabled;
60
55 this.isIndirectMessageBadgeEnabled = data.isIndirectMessageBadgeEnabled !== undefined 61 this.isIndirectMessageBadgeEnabled = data.isIndirectMessageBadgeEnabled !== undefined
56 ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; 62 ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled;
57 63
58 this.isMuted = data.isMuted !== undefined ? data.isMuted : this.isMuted; 64 this.isMuted = data.isMuted !== undefined ? data.isMuted : this.isMuted;
59 65
66 this.hasCustomUploadedIcon = data.hasCustomIcon !== undefined ? data.hasCustomIcon : this.hasCustomUploadedIcon;
67
60 this.recipe = recipe; 68 this.recipe = recipe;
61 69
62 autorun(() => { 70 autorun(() => {
@@ -93,15 +101,15 @@ export default class Service {
93 } 101 }
94 102
95 @computed get icon() { 103 @computed get icon() {
96 if (this.hasCustomIcon) { 104 if (this.iconUrl) {
97 return this.customIconUrl; 105 return this.iconUrl;
98 } 106 }
99 107
100 return path.join(this.recipe.path, 'icon.svg'); 108 return path.join(this.recipe.path, 'icon.svg');
101 } 109 }
102 110
103 @computed get hasCustomIcon() { 111 @computed get hasCustomIcon() {
104 return (this.customIconUrl !== ''); 112 return Boolean(this.iconUrl);
105 } 113 }
106 114
107 @computed get iconPNG() { 115 @computed get iconPNG() {