From 02fea44956b0156676c1adf502f999e5fdda1aae Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Thu, 6 Jul 2023 16:04:33 +0200 Subject: [PATCH] fix: initial playground env (#4167) --- .../component/playground/Playground/AdvancedPlayground.tsx | 2 +- .../playground/Playground/PlaygroundForm/PlaygroundForm.tsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx index 89d9ede07f..d618ffbdef 100644 --- a/frontend/src/component/playground/Playground/AdvancedPlayground.tsx +++ b/frontend/src/component/playground/Playground/AdvancedPlayground.tsx @@ -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)]); diff --git a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundForm.tsx b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundForm.tsx index 0e7c9de9c2..3446004a6c 100644 --- a/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundForm.tsx +++ b/frontend/src/component/playground/Playground/PlaygroundForm/PlaygroundForm.tsx @@ -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 = ({ context, setContext, }) => { - const theme = useTheme(); - return (