chore: compute only if value

This commit is contained in:
Ibrahima G. Coulibaly
2025-02-27 13:11:02 +00:00
parent 8d3b0b3840
commit 88a6cfd2fb
2 changed files with 14 additions and 15 deletions

View File

@@ -122,7 +122,7 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
const formRef = useRef<FormikProps<InitialValuesType>>(null);
const compute = (optionsValues: InitialValuesType, input: any) => {
const { indentationType, spacesCount } = optionsValues;
setResult(beautifyJson(input, indentationType, spacesCount));
if (input) setResult(beautifyJson(input, indentationType, spacesCount));
};
const getGroups: GetGroupsType<InitialValuesType> = ({