bring prompts into transition panel upon usage
This commit is contained in:
parent
d1edfd1114
commit
b721c0983e
|
@ -33,12 +33,7 @@ export default function PromptPanel({
|
|||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
const prompt = e.currentTarget.prompt.value;
|
||||
var promptLastIndex = prompts.length - 1;
|
||||
if (prompts[promptLastIndex - 1].prompt == "") {
|
||||
changePrompt(prompt, promptLastIndex - 1);
|
||||
} else {
|
||||
changePrompt(prompt, promptLastIndex);
|
||||
}
|
||||
changePrompt(prompt, prompts.length - 1);
|
||||
inputPrompt.current.value = "";
|
||||
}}
|
||||
>
|
||||
|
|
|
@ -90,8 +90,20 @@ export default function Home() {
|
|||
let newAppState = appState;
|
||||
|
||||
if (appState == AppState.SAME_PROMPT) {
|
||||
if (endPrompt) {
|
||||
if (upNextPrompt) {
|
||||
newAppState = AppState.TRANSITION;
|
||||
|
||||
// swap the last two prompts to bring the upNextPrompt into the next inference call
|
||||
setPromptInputs((prevPromptInputs) => {
|
||||
const newPromptInputs = [...prevPromptInputs];
|
||||
newPromptInputs[newPromptInputs.length - 1] = {
|
||||
prompt: endPrompt,
|
||||
};
|
||||
newPromptInputs[newPromptInputs.length - 2] = {
|
||||
prompt: upNextPrompt,
|
||||
};
|
||||
return newPromptInputs;
|
||||
});
|
||||
}
|
||||
setSeed(seed + 1);
|
||||
} else if (appState == AppState.TRANSITION) {
|
||||
|
|
Loading…
Reference in New Issue