Hacky implementation of variable autocomplete

This commit is contained in:
Gregory Schier
2023-10-23 10:31:21 -07:00
parent 4ad5d7f291
commit 83e2cab1b6
7 changed files with 83 additions and 61 deletions

View File

@@ -20,7 +20,6 @@ interface Props {
export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Props) {
const environments = useEnvironments();
const updateEnvironment = useUpdateEnvironment();
const activeRequest = useActiveRequest();
const dialog = useDialog();
@@ -82,7 +81,11 @@ const EnvironmentList = function({ environment }: EnvironmentListProps) {
className='w-full h-[400px] !bg-gray-50'
defaultValue={JSON.stringify(environment.data, null, 2)}
onChange={data => {
updateEnvironment.mutate({ data: JSON.parse(data) });
try {
updateEnvironment.mutate({ data: JSON.parse(data) });
} catch (err) {
// That's okay
}
}}
/>
</div>