mirror of
https://github.com/Unleash/unleash.git
synced 2025-12-21 20:06:40 +01:00
fix: don't attempt to get fetch strategies for new context fields on every key stroke (#11152)
Only renders the "ContextFieldUsage" component in the context form when the form is in edit mode. It doesn't make sense to render it for context fields that don't exist yet. Rendering this in the create form caused the Unleash to send a request to `/api/admin/context/:contextName/strategies` every time the name of the context field changes (i.e. every key stroke).
This commit is contained in:
parent
7369977b23
commit
62314aa66c
@ -262,7 +262,9 @@ export const ContextForm: React.FC<IContextForm> = ({
|
||||
/>
|
||||
<Typography>{stickiness ? 'On' : 'Off'}</Typography>
|
||||
</StyledSwitchContainer>
|
||||
<ContextFieldUsage contextName={contextName} />
|
||||
{mode === 'Edit' ? (
|
||||
<ContextFieldUsage contextName={contextName} />
|
||||
) : null}
|
||||
</div>
|
||||
<StyledButtonContainer>
|
||||
{children}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user