diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-23 03:22:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-23 01:22:52 +0000 |
commit | d24b5f351822e7575a98b84f03bb4ba303f2f40e (patch) | |
tree | 7a29ee70733069296221b65524d98df99e3d6863 /src | |
parent | Minor dependencies update (diff) | |
download | ferdium-app-d24b5f351822e7575a98b84f03bb4ba303f2f40e.tar.gz ferdium-app-d24b5f351822e7575a98b84f03bb4ba303f2f40e.tar.zst ferdium-app-d24b5f351822e7575a98b84f03bb4ba303f2f40e.zip |
fix: dont replace custom icon when service updates (#338)
Diffstat (limited to 'src')
-rw-r--r-- | src/internal-server/app/Controllers/Http/ServiceController.js | 5 | ||||
-rw-r--r-- | src/models/Service.js | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/internal-server/app/Controllers/Http/ServiceController.js b/src/internal-server/app/Controllers/Http/ServiceController.js index 89091aa57..44e4a7369 100644 --- a/src/internal-server/app/Controllers/Http/ServiceController.js +++ b/src/internal-server/app/Controllers/Http/ServiceController.js | |||
@@ -147,6 +147,7 @@ class ServiceController { | |||
147 | status: ['updated'], | 147 | status: ['updated'], |
148 | }); | 148 | }); |
149 | } | 149 | } |
150 | |||
150 | // Update service info | 151 | // Update service info |
151 | const data = request.all(); | 152 | const data = request.all(); |
152 | const { id } = params; | 153 | const { id } = params; |
@@ -155,6 +156,10 @@ class ServiceController { | |||
155 | const serviceQuery = await Service.query().where('serviceId', id).fetch(); | 156 | const serviceQuery = await Service.query().where('serviceId', id).fetch(); |
156 | const serviceData = serviceQuery.rows[0]; | 157 | const serviceData = serviceQuery.rows[0]; |
157 | 158 | ||
159 | if (data.customIcon === 'delete') { | ||
160 | data.iconId = ''; | ||
161 | } | ||
162 | |||
158 | const settings = { | 163 | const settings = { |
159 | ...convertToJSON(serviceData.settings), | 164 | ...convertToJSON(serviceData.settings), |
160 | ...data, | 165 | ...data, |
diff --git a/src/models/Service.js b/src/models/Service.js index 1adb1998b..53285e440 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -127,9 +127,7 @@ export default class Service { | |||
127 | this.name = ifUndefinedString(data.name, this.name); | 127 | this.name = ifUndefinedString(data.name, this.name); |
128 | this.team = ifUndefinedString(data.team, this.team); | 128 | this.team = ifUndefinedString(data.team, this.team); |
129 | this.customUrl = ifUndefinedString(data.customUrl, this.customUrl); | 129 | this.customUrl = ifUndefinedString(data.customUrl, this.customUrl); |
130 | // this.customIconUrl = ifUndefinedString(data.customIconUrl, this.customIconUrl); | ||
131 | this.iconUrl = ifUndefinedString(data.iconUrl, this.iconUrl); | 130 | this.iconUrl = ifUndefinedString(data.iconUrl, this.iconUrl); |
132 | |||
133 | this.order = ifUndefinedNumber(data.order, this.order); | 131 | this.order = ifUndefinedNumber(data.order, this.order); |
134 | this.isEnabled = ifUndefinedBoolean(data.isEnabled, this.isEnabled); | 132 | this.isEnabled = ifUndefinedBoolean(data.isEnabled, this.isEnabled); |
135 | this.isNotificationEnabled = ifUndefinedBoolean( | 133 | this.isNotificationEnabled = ifUndefinedBoolean( |
@@ -162,7 +160,7 @@ export default class Service { | |||
162 | this.isProgressbarEnabled, | 160 | this.isProgressbarEnabled, |
163 | ); | 161 | ); |
164 | this.hasCustomUploadedIcon = ifUndefinedBoolean( | 162 | this.hasCustomUploadedIcon = ifUndefinedBoolean( |
165 | data.hasCustomIcon, | 163 | data.iconId?.length > 0, |
166 | this.hasCustomUploadedIcon, | 164 | this.hasCustomUploadedIcon, |
167 | ); | 165 | ); |
168 | this.onlyShowFavoritesInUnreadCount = ifUndefinedBoolean( | 166 | this.onlyShowFavoritesInUnreadCount = ifUndefinedBoolean( |