1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: initial playground env (#4167)

This commit is contained in:
Mateusz Kwasniewski 2023-07-06 16:04:33 +02:00 committed by GitHub
parent 94bfa025c0
commit 02fea44956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -60,7 +60,7 @@ export const AdvancedPlayground: VFC<{
const [hasFormBeenSubmitted, setHasFormBeenSubmitted] = useState(false);
useEffect(() => {
if (environments?.length === 0) {
if (environments?.length === 0 && availableEnvironments.length > 0) {
setEnvironments([resolveDefaultEnvironment(availableEnvironments)]);
}
}, [JSON.stringify(environments), JSON.stringify(availableEnvironments)]);

View File

@ -1,4 +1,4 @@
import { Box, Button, Divider, useTheme } from '@mui/material';
import { Box, Button } from '@mui/material';
import { IEnvironment } from 'interfaces/environments';
import { FormEvent, VFC } from 'react';
import { PlaygroundCodeFieldset } from './PlaygroundCodeFieldset/PlaygroundCodeFieldset';
@ -25,8 +25,6 @@ export const PlaygroundForm: VFC<IPlaygroundFormProps> = ({
context,
setContext,
}) => {
const theme = useTheme();
return (
<Box
component="form"