aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/settings/EditServiceScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/settings/EditServiceScreen.js')
-rw-r--r--src/containers/settings/EditServiceScreen.js26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index 99c40b086..a7d33a3ea 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -92,10 +92,6 @@ 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
99 onSubmit(data) { 95 onSubmit(data) {
100 const { action } = this.props.router.params; 96 const { action } = this.props.router.params;
101 const { recipes, services } = this.props.stores; 97 const { recipes, services } = this.props.stores;
@@ -282,25 +278,16 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
282 } 278 }
283 } 279 }
284 280
285 openDarkmodeCss() { 281 openRecipeFile(file) {
286 const { openDarkmodeCss } = this.props.actions.service; 282 const { openRecipeFile } = this.props.actions.service;
287 const { action } = this.props.router.params; 283 const { action } = this.props.router.params;
288 284
289 if (action === 'edit') { 285 if (action === 'edit') {
290 this.setState({
291 isOpeningDarkModeCss: true,
292 });
293
294 const { activeSettings: service } = this.props.stores.services; 286 const { activeSettings: service } = this.props.stores.services;
295 openDarkmodeCss({ 287 openRecipeFile({
296 recipe: service.recipe.id, 288 recipe: service.recipe.id,
289 file,
297 }); 290 });
298
299 setTimeout(() => {
300 this.setState({
301 isOpeningDarkModeCss: false,
302 });
303 }, 2500);
304 } 291 }
305 } 292 }
306 293
@@ -355,8 +342,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
355 isDeleting={services.deleteServiceRequest.isExecuting} 342 isDeleting={services.deleteServiceRequest.isExecuting}
356 onSubmit={d => this.onSubmit(d)} 343 onSubmit={d => this.onSubmit(d)}
357 onDelete={() => this.deleteService()} 344 onDelete={() => this.deleteService()}
358 openDarkmodeCss={() => this.openDarkmodeCss()} 345 openRecipeFile={file => this.openRecipeFile(file)}
359 isOpeningDarkModeCss={this.state.isOpeningDarkModeCss}
360 isProxyFeatureEnabled={proxyFeature.isEnabled} 346 isProxyFeatureEnabled={proxyFeature.isEnabled}
361 isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan} 347 isServiceProxyIncludedInCurrentPlan={proxyFeature.isIncludedInCurrentPlan}
362 isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan} 348 isSpellcheckerIncludedInCurrentPlan={spellcheckerFeature.isIncludedInCurrentPlan}
@@ -384,7 +370,7 @@ EditServiceScreen.wrappedComponent.propTypes = {
384 createService: PropTypes.func.isRequired, 370 createService: PropTypes.func.isRequired,
385 updateService: PropTypes.func.isRequired, 371 updateService: PropTypes.func.isRequired,
386 deleteService: PropTypes.func.isRequired, 372 deleteService: PropTypes.func.isRequired,
387 openDarkmodeCss: PropTypes.func.isRequired, 373 openRecipeFile: PropTypes.func.isRequired,
388 }).isRequired, 374 }).isRequired,
389 // settings: PropTypes.shape({ 375 // settings: PropTypes.shape({
390 // update: PropTypes.func.isRequred, 376 // update: PropTypes.func.isRequred,