diff --git a/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/editor.tsx b/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/editor.tsx index 655834f49ca9fc..dd891b42f6856c 100644 --- a/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/editor.tsx +++ b/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/editor.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { CSSProperties, useEffect, useRef, useState } from 'react'; +import React, { CSSProperties, useCallback, useEffect, useRef, useState } from 'react'; import { EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -143,7 +143,7 @@ function _Editor({ previousStateLocation = 'stored' }: EditorProps) { }; }, []); - const sendCurrentRequestToES = () => { + const sendCurrentRequestToES = useCallback(() => { dispatch({ type: 'sendRequestToEs', value: { @@ -153,7 +153,7 @@ function _Editor({ previousStateLocation = 'stored' }: EditorProps) { history.addToHistory(esPath, esMethod, esData), }, }); - }; + }, [settings]); useEffect(() => { applyCurrentSettings(editorInstanceRef.current!, settings); @@ -167,7 +167,7 @@ function _Editor({ previousStateLocation = 'stored' }: EditorProps) { sendCurrentRequestToES, openDocumentation, }); - }, []); + }, [sendCurrentRequestToES]); return (
diff --git a/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/keyboard_shortcuts.ts b/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/keyboard_shortcuts.ts index be1826afd78275..1be571f2739ac1 100644 --- a/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/keyboard_shortcuts.ts +++ b/src/legacy/core_plugins/console/np_ready/public/application/containers/editor/legacy/console_editor/keyboard_shortcuts.ts @@ -18,7 +18,7 @@ */ interface Actions { - input: any; + input: any; // TODO: Wrap this in an editor interface sendCurrentRequestToES: () => void; openDocumentation: () => void; }