mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: optional access
This commit is contained in:
		
							parent
							
								
									fc6cc9a2cd
								
							
						
					
					
						commit
						88a44c03ba
					
				@ -15,8 +15,9 @@ export const useCurrentStrategy = (
 | 
				
			|||||||
    environmentName: string,
 | 
					    environmentName: string,
 | 
				
			||||||
) => {
 | 
					) => {
 | 
				
			||||||
    const { feature: currentFeature } = useFeature(project, feature);
 | 
					    const { feature: currentFeature } = useFeature(project, feature);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const currentStrategy = currentFeature?.environments
 | 
					    const currentStrategy = currentFeature?.environments
 | 
				
			||||||
        .find((environment) => environment.name === environmentName)
 | 
					        ?.find((environment) => environment.name === environmentName)
 | 
				
			||||||
        ?.strategies.find(
 | 
					        ?.strategies.find(
 | 
				
			||||||
            (strategy) =>
 | 
					            (strategy) =>
 | 
				
			||||||
                'id' in change.payload && strategy.id === change.payload.id,
 | 
					                'id' in change.payload && strategy.id === change.payload.id,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user