aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/Service.js
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-04 22:10:28 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-09-05 05:01:51 +0530
commit92627555c6b0d56c96a95e31780e3015b3e637e9 (patch)
tree314beb586594c964dc5dbbb77bc47183ba273dd7 /src/models/Service.js
parentchore: auto-generated files [skip ci] (diff)
downloadferdium-app-92627555c6b0d56c96a95e31780e3015b3e637e9.tar.gz
ferdium-app-92627555c6b0d56c96a95e31780e3015b3e637e9.tar.zst
ferdium-app-92627555c6b0d56c96a95e31780e3015b3e637e9.zip
refactoring: Use 'ifUndefined*' consistently.
Added some error checking
Diffstat (limited to 'src/models/Service.js')
-rw-r--r--src/models/Service.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/models/Service.js b/src/models/Service.js
index dbbd622aa..ee6fe8b6e 100644
--- a/src/models/Service.js
+++ b/src/models/Service.js
@@ -106,13 +106,12 @@ export default class Service {
106 106
107 this.userAgentModel = new UserAgent(recipe.overrideUserAgent); 107 this.userAgentModel = new UserAgent(recipe.overrideUserAgent);
108 108
109 // TODO: Should these also follow the 'ifUndefined*' style? 109 this.id = ifUndefinedString(data.id, this.id);
110 this.id = data.id || this.id; 110 this.name = ifUndefinedString(data.name, this.name);
111 this.name = data.name || this.name; 111 this.team = ifUndefinedString(data.team, this.team);
112 this.team = data.team || this.team; 112 this.customUrl = ifUndefinedString(data.customUrl, this.customUrl);
113 this.customUrl = data.customUrl || this.customUrl; 113 // this.customIconUrl = ifUndefinedString(data.customIconUrl, this.customIconUrl);
114 // this.customIconUrl = data.customIconUrl || this.customIconUrl; 114 this.iconUrl = ifUndefinedString(data.iconUrl, this.iconUrl);
115 this.iconUrl = data.iconUrl || this.iconUrl;
116 115
117 this.order = ifUndefinedNumber(data.order, this.order); 116 this.order = ifUndefinedNumber(data.order, this.order);
118 this.isEnabled = ifUndefinedBoolean(data.isEnabled, this.isEnabled); 117 this.isEnabled = ifUndefinedBoolean(data.isEnabled, this.isEnabled);