diff options
author | 2018-01-03 23:46:54 +0100 | |
---|---|---|
committer | 2018-01-03 23:46:54 +0100 | |
commit | be801ff55d765e519f58a34d9854fb464a1ff77e (patch) | |
tree | 48c7972577c6b73cb5ca0d1947c5a8b198b98614 /src/containers | |
parent | Fix lint issues (diff) | |
download | ferdium-app-be801ff55d765e519f58a34d9854fb464a1ff77e.tar.gz ferdium-app-be801ff55d765e519f58a34d9854fb464a1ff77e.tar.zst ferdium-app-be801ff55d765e519f58a34d9854fb464a1ff77e.zip |
feat(App): Add option to clear app cache (@dannyqiu)
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 11 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 14 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 78f043e80..3c52152b1 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -169,14 +169,6 @@ export default class EditServiceScreen extends Component { | |||
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | clearCache() { | ||
173 | const { clearCache } = this.props.actions.service; | ||
174 | const { activeSettings: service } = this.props.stores.services; | ||
175 | clearCache({ | ||
176 | serviceId: service.id, | ||
177 | }); | ||
178 | } | ||
179 | |||
180 | render() { | 172 | render() { |
181 | const { recipes, services, user } = this.props.stores; | 173 | const { recipes, services, user } = this.props.stores; |
182 | const { action } = this.props.router.params; | 174 | const { action } = this.props.router.params; |
@@ -219,10 +211,8 @@ export default class EditServiceScreen extends Component { | |||
219 | status={services.actionStatus} | 211 | status={services.actionStatus} |
220 | isSaving={services.updateServiceRequest.isExecuting || services.createServiceRequest.isExecuting} | 212 | isSaving={services.updateServiceRequest.isExecuting || services.createServiceRequest.isExecuting} |
221 | isDeleting={services.deleteServiceRequest.isExecuting} | 213 | isDeleting={services.deleteServiceRequest.isExecuting} |
222 | isClearingCache={services.clearCacheRequest.isExecuting} | ||
223 | onSubmit={d => this.onSubmit(d)} | 214 | onSubmit={d => this.onSubmit(d)} |
224 | onDelete={() => this.deleteService()} | 215 | onDelete={() => this.deleteService()} |
225 | onClearCache={() => this.clearCache()} | ||
226 | /> | 216 | /> |
227 | ); | 217 | ); |
228 | } | 218 | } |
@@ -244,7 +234,6 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
244 | createService: PropTypes.func.isRequired, | 234 | createService: PropTypes.func.isRequired, |
245 | updateService: PropTypes.func.isRequired, | 235 | updateService: PropTypes.func.isRequired, |
246 | deleteService: PropTypes.func.isRequired, | 236 | deleteService: PropTypes.func.isRequired, |
247 | clearCache: PropTypes.func.isRequired, | ||
248 | }).isRequired, | 237 | }).isRequired, |
249 | }).isRequired, | 238 | }).isRequired, |
250 | }; | 239 | }; |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 890bf6501..9fa815a0a 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -193,8 +193,17 @@ export default class EditSettingsScreen extends Component { | |||
193 | } | 193 | } |
194 | 194 | ||
195 | render() { | 195 | render() { |
196 | const { updateStatus, updateStatusTypes, isClearingAllCache } = this.props.stores.app; | 196 | const { |
197 | const { checkForUpdates, installUpdate, clearAllCache } = this.props.actions.app; | 197 | updateStatus, |
198 | cacheSize, | ||
199 | updateStatusTypes, | ||
200 | isClearingAllCache, | ||
201 | } = this.props.stores.app; | ||
202 | const { | ||
203 | checkForUpdates, | ||
204 | installUpdate, | ||
205 | clearAllCache, | ||
206 | } = this.props.actions.app; | ||
198 | const form = this.prepareForm(); | 207 | const form = this.prepareForm(); |
199 | 208 | ||
200 | return ( | 209 | return ( |
@@ -207,6 +216,7 @@ export default class EditSettingsScreen extends Component { | |||
207 | noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} | 216 | noUpdateAvailable={updateStatus === updateStatusTypes.NOT_AVAILABLE} |
208 | updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} | 217 | updateIsReadyToInstall={updateStatus === updateStatusTypes.DOWNLOADED} |
209 | onSubmit={d => this.onSubmit(d)} | 218 | onSubmit={d => this.onSubmit(d)} |
219 | cacheSize={cacheSize} | ||
210 | isClearingAllCache={isClearingAllCache} | 220 | isClearingAllCache={isClearingAllCache} |
211 | onClearAllCache={clearAllCache} | 221 | onClearAllCache={clearAllCache} |
212 | /> | 222 | /> |