summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-06 00:25:41 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-06 00:25:41 -0700
commit4ae4e778684552a0bba5eecb20983af1b9d1de00 (patch)
treeb9972bc84d50f6f3e3ab28cd88f68de7d4b7e0f5 /extension/react-app/src/tabs
parentcf3d02c198e3e076da477ff7d1dc27182d2f8aa3 (diff)
downloadsncontinue-4ae4e778684552a0bba5eecb20983af1b9d1de00.tar.gz
sncontinue-4ae4e778684552a0bba5eecb20983af1b9d1de00.tar.bz2
sncontinue-4ae4e778684552a0bba5eecb20983af1b9d1de00.zip
fixing command history and dropdown
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r--extension/react-app/src/tabs/gui.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index 3cce30de..ca369547 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -139,9 +139,16 @@ function GUI(props: GUIProps) {
useEffect(() => {
const listener = (e: any) => {
- // Cmd + J to toggle fast model
+ // Cmd + i to toggle fast model
if (e.key === "i" && e.metaKey && e.shiftKey) {
setUsingFastModel((prev) => !prev);
+ // Cmd + backspace to stop currently running step
+ } else if (
+ e.key === "Backspace" &&
+ e.metaKey &&
+ typeof history?.current_index !== "undefined"
+ ) {
+ client?.deleteAtIndex(history.current_index);
}
};
window.addEventListener("keydown", listener);
@@ -149,7 +156,7 @@ function GUI(props: GUIProps) {
return () => {
window.removeEventListener("keydown", listener);
};
- }, []);
+ }, [client, history]);
useEffect(() => {
client?.onStateUpdate((state: FullState) => {