From 8e15ec3c2c1490d4a7d6371f877368376fd64e8a Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 6 Jul 2023 23:10:18 -0700 Subject: fix: :bug: fix command enter, stop streaming on reject --- extension/react-app/src/tabs/gui.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'extension/react-app/src/tabs/gui.tsx') diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index 1ea70dd2..e1ecec9e 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -217,9 +217,13 @@ function GUI(props: GUIProps) { [client] ); - const onMainTextInput = () => { + const onMainTextInput = (event?: any) => { if (mainTextInputRef.current) { - const input = (mainTextInputRef.current as any).inputValue; + let input = (mainTextInputRef.current as any).inputValue; + // cmd+enter to /edit + if (event?.metaKey) { + input = `/edit ${input}`; + } (mainTextInputRef.current as any).setInputValue(""); if (!client) return; @@ -352,7 +356,7 @@ function GUI(props: GUIProps) { // } ref={mainTextInputRef} onEnter={(e) => { - onMainTextInput(); + onMainTextInput(e); e.stopPropagation(); e.preventDefault(); }} -- cgit v1.2.3-70-g09d2