diff options
author | 2017-12-29 01:31:52 -0500 | |
---|---|---|
committer | 2017-12-29 01:31:52 -0500 | |
commit | 9e2a998cccee808d8f2f16d4dc6f45d3c069ec32 (patch) | |
tree | 8e87439eec28d47d4f4c7312d0f0da45e38de87b /src/stores | |
parent | Log event on second instnace of Franz (diff) | |
download | ferdium-app-9e2a998cccee808d8f2f16d4dc6f45d3c069ec32.tar.gz ferdium-app-9e2a998cccee808d8f2f16d4dc6f45d3c069ec32.tar.zst ferdium-app-9e2a998cccee808d8f2f16d4dc6f45d3c069ec32.zip |
Add button to clear service cache
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 66f37af26..237264bcc 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -16,6 +16,7 @@ export default class ServicesStore extends Store { | |||
16 | @observable updateServiceRequest = new Request(this.api.services, 'update'); | 16 | @observable updateServiceRequest = new Request(this.api.services, 'update'); |
17 | @observable reorderServicesRequest = new Request(this.api.services, 'reorder'); | 17 | @observable reorderServicesRequest = new Request(this.api.services, 'reorder'); |
18 | @observable deleteServiceRequest = new Request(this.api.services, 'delete'); | 18 | @observable deleteServiceRequest = new Request(this.api.services, 'delete'); |
19 | @observable clearCacheRequest = new Request(this.api.services, 'clearCache'); | ||
19 | 20 | ||
20 | @observable filterNeedle = null; | 21 | @observable filterNeedle = null; |
21 | 22 | ||
@@ -31,6 +32,7 @@ export default class ServicesStore extends Store { | |||
31 | this.actions.service.createFromLegacyService.listen(this._createFromLegacyService.bind(this)); | 32 | this.actions.service.createFromLegacyService.listen(this._createFromLegacyService.bind(this)); |
32 | this.actions.service.updateService.listen(this._updateService.bind(this)); | 33 | this.actions.service.updateService.listen(this._updateService.bind(this)); |
33 | this.actions.service.deleteService.listen(this._deleteService.bind(this)); | 34 | this.actions.service.deleteService.listen(this._deleteService.bind(this)); |
35 | this.actions.service.clearCache.listen(this._clearCache.bind(this)); | ||
34 | this.actions.service.setWebviewReference.listen(this._setWebviewReference.bind(this)); | 36 | this.actions.service.setWebviewReference.listen(this._setWebviewReference.bind(this)); |
35 | this.actions.service.focusService.listen(this._focusService.bind(this)); | 37 | this.actions.service.focusService.listen(this._focusService.bind(this)); |
36 | this.actions.service.focusActiveService.listen(this._focusActiveService.bind(this)); | 38 | this.actions.service.focusActiveService.listen(this._focusActiveService.bind(this)); |
@@ -205,6 +207,13 @@ export default class ServicesStore extends Store { | |||
205 | gaEvent('Service', 'delete', service.recipe.id); | 207 | gaEvent('Service', 'delete', service.recipe.id); |
206 | } | 208 | } |
207 | 209 | ||
210 | @action async _clearCache({ serviceId }) { | ||
211 | this.clearCacheRequest.reset(); | ||
212 | const request = this.clearCacheRequest.execute(serviceId); | ||
213 | await request._promise; | ||
214 | gaEvent('Service', 'clear cache'); | ||
215 | } | ||
216 | |||
208 | @action _setActive({ serviceId }) { | 217 | @action _setActive({ serviceId }) { |
209 | const service = this.one(serviceId); | 218 | const service = this.one(serviceId); |
210 | 219 | ||