diff --git a/src/main/js/components/editor/editor.js b/src/main/js/components/editor/editor.js index 63886e3..6257c4e 100644 --- a/src/main/js/components/editor/editor.js +++ b/src/main/js/components/editor/editor.js @@ -35,13 +35,13 @@ function Editor({query, setQuery, handleRunQuery, handleFormatQuery}) { if (handleFormatQuery) { commands.push({ name: 'format query', - exec: handleFormatQuery, + exec: () => handleFormatQuery(query), bindKey: {mac: "Command-Option-L", win: "Ctrl-Alt-L"} }) } editor.commands.addCommands(commands) } - }, [editorRef?.current?.editor]) + }, [editorRef?.current?.editor, query]) return ( + onClick={(e) => prettifyJsonQuery(query)}>