mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: flickering dialogue (#2558)
* This PR fixes an issue with flickering states in the change request dialogue
This commit is contained in:
		
							parent
							
								
									87d9466005
								
							
						
					
					
						commit
						5b24b60d31
					
				| @ -12,7 +12,7 @@ export const UpdateEnabledMessage = ({ | |||||||
|     environment, |     environment, | ||||||
| }: UpdateEnabledMsg) => ( | }: UpdateEnabledMsg) => ( | ||||||
|     <Typography> |     <Typography> | ||||||
|         <strong>{enabled ? 'Disable' : 'Enable'}</strong> feature toggle{' '} |         <strong>{enabled ? 'Enable' : 'Disable'}</strong> feature toggle{' '} | ||||||
|         <strong>{featureName}</strong> in <strong>{environment}</strong> |         <strong>{featureName}</strong> in <strong>{environment}</strong> | ||||||
|     </Typography> |     </Typography> | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -31,7 +31,7 @@ export const useChangeRequestToggle = (project: string) => { | |||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     const onChangeRequestToggleClose = useCallback(() => { |     const onChangeRequestToggleClose = useCallback(() => { | ||||||
|         setChangeRequestDialogDetails({ isOpen: false }); |         setChangeRequestDialogDetails(prev => ({ ...prev, isOpen: false })); | ||||||
|     }, []); |     }, []); | ||||||
| 
 | 
 | ||||||
|     const onChangeRequestToggleConfirm = useCallback(async () => { |     const onChangeRequestToggleConfirm = useCallback(async () => { | ||||||
| @ -48,14 +48,14 @@ export const useChangeRequestToggle = (project: string) => { | |||||||
|                 } |                 } | ||||||
|             ); |             ); | ||||||
|             refetchChangeRequests(); |             refetchChangeRequests(); | ||||||
|             setChangeRequestDialogDetails({ isOpen: false }); |             setChangeRequestDialogDetails(prev => ({ ...prev, isOpen: false })); | ||||||
|             setToastData({ |             setToastData({ | ||||||
|                 type: 'success', |                 type: 'success', | ||||||
|                 title: 'Changes added to the draft!', |                 title: 'Changes added to the draft!', | ||||||
|             }); |             }); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             setToastApiError(formatUnknownError(error)); |             setToastApiError(formatUnknownError(error)); | ||||||
|             setChangeRequestDialogDetails({ isOpen: false }); |             setChangeRequestDialogDetails(prev => ({ ...prev, isOpen: false })); | ||||||
|         } |         } | ||||||
|     }, [addChangeRequest]); |     }, [addChangeRequest]); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user