SimpleChat:MCUI: Delay enabling user-input to avoid race
Re-enable user-input, only after response to a user query has been updated to the chat-div. This ensures that if user tries to switch chat session, it wont be allowed till chat-request-response flow is done.
This commit is contained in:
parent
928cc36427
commit
d57274b2a3
1 changed files with 2 additions and 2 deletions
|
@ -265,8 +265,6 @@ class MultiChatUI {
|
|||
body: theBody,
|
||||
});
|
||||
|
||||
this.elInUser.value = "";
|
||||
this.elInUser.disabled = false;
|
||||
let respBody = await resp.json();
|
||||
console.debug(`DBUG:MCUI:${chatId}:HandleUserSubmit:RespBody:${JSON.stringify(respBody)}`);
|
||||
let assistantMsg;
|
||||
|
@ -288,6 +286,8 @@ class MultiChatUI {
|
|||
if ((apiEP == ApiEP.Completion) && (gbCompletionFreshChatAlways)) {
|
||||
chat.xchat.length = 0;
|
||||
}
|
||||
this.elInUser.value = "";
|
||||
this.elInUser.disabled = false;
|
||||
this.elInUser.focus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue