fix: prevent agent debug from blocking chat
This commit is contained in:
@@ -23,14 +23,23 @@ function resize() {
|
||||
element.style.overflowY = element.scrollHeight > 108 ? "auto" : "hidden";
|
||||
}
|
||||
|
||||
function send() {
|
||||
async function send() {
|
||||
const text = input.value.trim();
|
||||
if (!text) return;
|
||||
// Sending has been accepted by the composer. Clear immediately instead of
|
||||
// keeping the submitted text visible until the entire AI stream finishes.
|
||||
input.value = "";
|
||||
await nextTick();
|
||||
resize();
|
||||
emit("send", text, async (success) => {
|
||||
if (!success) return;
|
||||
input.value = "";
|
||||
await nextTick();
|
||||
resize();
|
||||
// Restore only when the parent rejected/failed the request and the user has
|
||||
// not entered replacement text in the meantime.
|
||||
if (!success && !input.value) {
|
||||
input.value = text;
|
||||
await nextTick();
|
||||
resize();
|
||||
textarea.value?.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user