diff --git a/web/src/components/Editor/JsonEditor.tsx b/web/src/components/Editor/JsonEditor.tsx index fef9150eab..76e225e3be 100644 --- a/web/src/components/Editor/JsonEditor.tsx +++ b/web/src/components/Editor/JsonEditor.tsx @@ -33,10 +33,11 @@ function JsonEditor(props: { value: string; onChange?: (value: string | undefine onChange(editorRef.current?.getValue()); }); } - }, [onChange]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); useEffect(() => { - if (monacoEl && editorRef.current) { + if (monacoEl && editorRef.current && value !== editorRef.current?.getValue()) { editorRef.current?.getModel()?.setValue(value); } }, [value]); diff --git a/web/src/components/Editor/typesResolve/index.ts b/web/src/components/Editor/typesResolve/index.ts index c33b6bbaae..8e0e5f202f 100644 --- a/web/src/components/Editor/typesResolve/index.ts +++ b/web/src/components/Editor/typesResolve/index.ts @@ -76,23 +76,25 @@ export class AutoImportTypings { if (!this.isLoaded("globals")) { this.loadDeclaration("globals"); } - // if (!this.isLoaded("database-proxy")) { - // this.loadDeclaration("database-proxy"); - // } - // if (!this.isLoaded("database-ql")) { - // this.loadDeclaration("database-ql"); - // } - // if (!this.isLoaded("axios")) { - // this.loadDeclaration("axios"); - // } - // // if (!this.isLoaded('cloud-function-engine')) { this.loadDeclaration('cloud-function-engine') } - // if (!this.isLoaded("mongodb")) { - // this.loadDeclaration("mongodb"); - // } - // if (!this.isLoaded("@types/node")) { - // this.loadDeclaration("@types/node"); - // } - // if (!this.isLoaded('ws')) { this.loadDeclaration('ws') } + if (!this.isLoaded("database-proxy")) { + this.loadDeclaration("database-proxy"); + } + if (!this.isLoaded("database-ql")) { + this.loadDeclaration("database-ql"); + } + if (!this.isLoaded("axios")) { + this.loadDeclaration("axios"); + } + // if (!this.isLoaded('cloud-function-engine')) { this.loadDeclaration('cloud-function-engine') } + if (!this.isLoaded("mongodb")) { + this.loadDeclaration("mongodb"); + } + if (!this.isLoaded("@types/node")) { + this.loadDeclaration("@types/node"); + } + if (!this.isLoaded("ws")) { + this.loadDeclaration("ws"); + } } /**