mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: remove playground results flip (#4076)
This commit is contained in:
parent
7a5c77376a
commit
175b103b12
@ -57,6 +57,7 @@ export const AdvancedPlayground: VFC<{
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const searchParamsLength = Array.from(searchParams.entries()).length;
|
||||
const { evaluateAdvancedPlayground, loading } = usePlaygroundApi();
|
||||
const [hasFormBeenSubmitted, setHasFormBeenSubmitted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (environments?.length === 0) {
|
||||
@ -167,6 +168,8 @@ export const AdvancedPlayground: VFC<{
|
||||
const onSubmit: FormEventHandler<HTMLFormElement> = async event => {
|
||||
event.preventDefault();
|
||||
|
||||
setHasFormBeenSubmitted(true);
|
||||
|
||||
await evaluatePlaygroundContext(environments, projects, context, () => {
|
||||
setURLParameters();
|
||||
setValue({
|
||||
@ -272,17 +275,25 @@ export const AdvancedPlayground: VFC<{
|
||||
condition={loading}
|
||||
show={<Loader />}
|
||||
elseShow={
|
||||
<ConditionallyRender
|
||||
condition={Boolean(results)}
|
||||
show={
|
||||
<AdvancedPlaygroundResultsTable
|
||||
loading={loading}
|
||||
features={results?.features}
|
||||
input={results?.input}
|
||||
/>
|
||||
}
|
||||
elseShow={<PlaygroundGuidance />}
|
||||
/>
|
||||
<>
|
||||
<ConditionallyRender
|
||||
condition={Boolean(results)}
|
||||
show={
|
||||
<AdvancedPlaygroundResultsTable
|
||||
loading={loading}
|
||||
features={results?.features}
|
||||
input={results?.input}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
!Boolean(results) &&
|
||||
!hasFormBeenSubmitted
|
||||
}
|
||||
show={<PlaygroundGuidance />}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user