diff options
Diffstat (limited to 'src/containers/settings/EditServiceScreen.js')
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index e4ff03bb3..d18d7fb9b 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -92,6 +92,10 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
92 | intl: intlShape, | 92 | intl: intlShape, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | state = { | ||
96 | isOpeningDarkModeCss: false, | ||
97 | } | ||
98 | |||
95 | onSubmit(data) { | 99 | onSubmit(data) { |
96 | const { action } = this.props.router.params; | 100 | const { action } = this.props.router.params; |
97 | const { recipes, services } = this.props.stores; | 101 | const { recipes, services } = this.props.stores; |
@@ -278,6 +282,28 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
278 | } | 282 | } |
279 | } | 283 | } |
280 | 284 | ||
285 | openDarkmodeCss() { | ||
286 | const { openDarkmodeCss } = this.props.actions.service; | ||
287 | const { action } = this.props.router.params; | ||
288 | |||
289 | if (action === 'edit') { | ||
290 | this.setState({ | ||
291 | isOpeningDarkModeCss: true, | ||
292 | }); | ||
293 | |||
294 | const { activeSettings: service } = this.props.stores.services; | ||
295 | openDarkmodeCss({ | ||
296 | recipe: service.recipe.id, | ||
297 | }); | ||
298 | |||
299 | setTimeout(() => { | ||
300 | this.setState({ | ||
301 | isOpeningDarkModeCss: false, | ||
302 | }); | ||
303 | }, 2500); | ||
304 | } | ||
305 | } | ||
306 | |||
281 | render() { | 307 | render() { |
282 | const { recipes, services, user } = this.props.stores; | 308 | const { recipes, services, user } = this.props.stores; |
283 | const { action } = this.props.router.params; | 309 | const { action } = this.props.router.params; |
@@ -329,6 +355,8 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
329 | isDeleting={services.deleteServiceRequest.isExecuting} | 355 | isDeleting={services.deleteServiceRequest.isExecuting} |
330 | onSubmit={d => this.onSubmit(d)} | 356 | onSubmit={d => this.onSubmit(d)} |
331 | onDelete={() => this.deleteService()} | 357 | onDelete={() => this.deleteService()} |
358 | openDarkmodeCss={() => this.openDarkmodeCss()} | ||
359 | isOpeningDarkModeCss={this.state.isOpeningDarkModeCss} | ||
332 | isProxyFeatureEnabled={proxyFeature.isEnabled} | 360 | isProxyFeatureEnabled={proxyFeature.isEnabled} |
333 | isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} | 361 | isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} |
334 | isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} | 362 | isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} |
@@ -356,6 +384,7 @@ EditServiceScreen.wrappedComponent.propTypes = { | |||
356 | createService: PropTypes.func.isRequired, | 384 | createService: PropTypes.func.isRequired, |
357 | updateService: PropTypes.func.isRequired, | 385 | updateService: PropTypes.func.isRequired, |
358 | deleteService: PropTypes.func.isRequired, | 386 | deleteService: PropTypes.func.isRequired, |
387 | openDarkmodeCss: PropTypes.func.isRequired, | ||
359 | }).isRequired, | 388 | }).isRequired, |
360 | // settings: PropTypes.shape({ | 389 | // settings: PropTypes.shape({ |
361 | // update: PropTypes.func.isRequred, | 390 | // update: PropTypes.func.isRequred, |