mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02: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