Skip to content

Commit

Permalink
[BUGFIX] Fix prettify (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemick authored Mar 5, 2024
1 parent bf6fa79 commit e4c9c81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion intellij-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginGroup=com.lemick
pluginName=hoverfly-ui-intellij-plugin
pluginRepositoryUrl=https://github.com/Lemick/hoverfly-ui
pluginVersion=1.1.0
pluginVersion=1.1.1
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=222
pluginUntilBuild=233.*
Expand Down
8 changes: 7 additions & 1 deletion ui/src/components/forms/ResponseBodyEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useRef, useState } from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import MonacoEditor, { Monaco, OnMount } from '@monaco-editor/react';
import { isJSON } from '@/services/json-service';
import { editor } from 'monaco-editor';
Expand All @@ -20,6 +20,12 @@ const ResponseBodyEditor = ({ value = '', onChange }: Props) => {
const [editorHeightPx, setEditorHeightPx] = useState(100);
const { appliedTheme } = useTheme();

useEffect(() => {
if (!editorRef.current?.hasTextFocus() && editorRef.current?.getValue() != value) {
editorRef.current?.setValue(value);
}
}, [value]);

const onEditorMount: OnMount = (editor, monaco) => {
editorRef.current = editor;
monacoRef.current = monaco;
Expand Down

0 comments on commit e4c9c81

Please sign in to comment.