summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-03 19:34:33 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-03 19:34:33 -0700
commit97f477e4dd64165738a6beab74edf09ef355a55a (patch)
tree352ebe3e0bd37a53f54732184b507334f531430c /extension/react-app/src/tabs
parenta37550d5acc0c79efd18c80d9be3dcb3999dd4e9 (diff)
downloadsncontinue-97f477e4dd64165738a6beab74edf09ef355a55a.tar.gz
sncontinue-97f477e4dd64165738a6beab74edf09ef355a55a.tar.bz2
sncontinue-97f477e4dd64165738a6beab74edf09ef355a55a.zip
fix python version on windows, other bugs, jest
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r--extension/react-app/src/tabs/gui.tsx43
1 files changed, 24 insertions, 19 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index e0b32a24..58aab984 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -215,30 +215,35 @@ function GUI(props: GUIProps) {
mainTextInputRef.current.value = "";
if (!client) return;
+ setWaitingForSteps(true);
+
if (
- history?.timeline.length &&
- history.timeline[history.current_index].step.name ===
- "Waiting for user input"
+ history &&
+ history.current_index >= 0 &&
+ history.current_index < history.timeline.length
) {
- if (input.trim() === "") return;
- onStepUserInput(input, history!.current_index);
- } else if (
- history?.timeline.length &&
- history.timeline[history.current_index].step.name ===
+ if (
+ history.timeline[history.current_index].step.name ===
+ "Waiting for user input"
+ ) {
+ if (input.trim() === "") return;
+ onStepUserInput(input, history!.current_index);
+ return;
+ } else if (
+ history.timeline[history.current_index].step.name ===
"Waiting for user confirmation"
- ) {
- onStepUserInput("ok", history!.current_index);
- } else {
- if (input.trim() === "") return;
-
- client.sendMainInput(input);
- setUserInputQueue((queue) => {
- return [...queue, input];
- });
+ ) {
+ onStepUserInput("ok", history!.current_index);
+ return;
+ }
}
- }
+ if (input.trim() === "") return;
- setWaitingForSteps(true);
+ client.sendMainInput(input);
+ setUserInputQueue((queue) => {
+ return [...queue, input];
+ });
+ }
};
const onStepUserInput = (input: string, index: number) => {