mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: wrong environment name in strategy creation
This commit is contained in:
		
							parent
							
								
									f4681a3883
								
							
						
					
					
						commit
						93fb9fb66a
					
				| @ -61,7 +61,7 @@ const FeatureToggleListNewItem = ({ | ||||
|         } | ||||
|     }; | ||||
| 
 | ||||
|     const handleToggle = (env: IEnvironments, e: SyntheticEvent) => { | ||||
|     const handleToggle = (env: IEnvironments) => { | ||||
|         toggleFeatureByEnvironment(env.name, env.enabled) | ||||
|             .then(() => { | ||||
|                 setToastData({ | ||||
| @ -73,7 +73,6 @@ const FeatureToggleListNewItem = ({ | ||||
|             }) | ||||
|             .catch(e => { | ||||
|                 if (e.message === ENVIRONMENT_STRATEGY_ERROR) { | ||||
|                     setEnvironmentName(env.name); | ||||
|                     setShowInfoBox(true); | ||||
|                 } else { | ||||
|                     setToastData({ | ||||
| @ -150,7 +149,10 @@ const FeatureToggleListNewItem = ({ | ||||
|                                     projectId={projectId} | ||||
|                                     permission={UPDATE_FEATURE} | ||||
|                                     ref={ref} | ||||
|                                     onClick={handleToggle.bind(this, env)} | ||||
|                                     onClick={() => { | ||||
|                                         handleToggle(env); | ||||
|                                         setEnvironmentName(env.name); | ||||
|                                     }} | ||||
|                                 /> | ||||
|                             </span> | ||||
|                         </TableCell> | ||||
|  | ||||
| @ -62,7 +62,6 @@ const FeatureStrategiesEnvironments = () => { | ||||
|     useEffect(() => { | ||||
|         if (addStrategy) { | ||||
|             setExpandedSidebar(true); | ||||
|             history.replace(history.location.pathname); | ||||
|         } | ||||
|         if (!feature) return; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user