diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-06 23:10:18 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-06 23:10:18 -0700 |
commit | 8e15ec3c2c1490d4a7d6371f877368376fd64e8a (patch) | |
tree | e8c113a64d489713246c86d2282380666de78a02 /extension/react-app/src/tabs | |
parent | c31d8e003ac08f31e02ca647095b19b4267a47cf (diff) | |
download | sncontinue-8e15ec3c2c1490d4a7d6371f877368376fd64e8a.tar.gz sncontinue-8e15ec3c2c1490d4a7d6371f877368376fd64e8a.tar.bz2 sncontinue-8e15ec3c2c1490d4a7d6371f877368376fd64e8a.zip |
fix: :bug: fix command enter, stop streaming on reject
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r-- | extension/react-app/src/tabs/gui.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
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(); }} |