diff options
| author | Ty Dunn <ty@tydunn.com> | 2023-07-03 19:42:38 -0700 | 
|---|---|---|
| committer | Ty Dunn <ty@tydunn.com> | 2023-07-03 19:42:38 -0700 | 
| commit | 6016e78b353d5afae9fe0a68c718fa2b2216dc5c (patch) | |
| tree | 5602740ba169db7ac40ac6abac5ac6beb176d263 /extension/react-app/src/tabs | |
| parent | 99cd41b8901a09c4f5e5a1e0fc78a93ee2306f2e (diff) | |
| parent | 227c0635cf324ff212200fe38835b8015a3635bd (diff) | |
| download | sncontinue-6016e78b353d5afae9fe0a68c718fa2b2216dc5c.tar.gz sncontinue-6016e78b353d5afae9fe0a68c718fa2b2216dc5c.tar.bz2 sncontinue-6016e78b353d5afae9fe0a68c718fa2b2216dc5c.zip | |
Merge branch 'main' of github.com:continuedev/continue
Diffstat (limited to 'extension/react-app/src/tabs')
| -rw-r--r-- | extension/react-app/src/tabs/gui.tsx | 43 | 
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 973982ba..cccd184e 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) => { | 
