Fix stop button not showing for the second speaking member in queue

This commit is contained in:
SillyLossy
2023-05-31 23:38:18 +03:00
parent a18c20305e
commit 35cb1f6182
2 changed files with 8 additions and 4 deletions

View File

@ -3294,14 +3294,14 @@ export function isMultigenEnabled() {
return power_user.multigen && (main_api == 'textgenerationwebui' || main_api == 'kobold' || main_api == 'koboldhorde' || main_api == 'novel');
}
function activateSendButtons() {
export function activateSendButtons() {
is_send_press = false;
$("#send_but").css("display", "flex");
$("#send_textarea").attr("disabled", false);
hideStopButton();
}
function deactivateSendButtons() {
export function deactivateSendButtons() {
$("#send_but").css("display", "none");
showStopButton();
}

View File

@ -51,6 +51,8 @@ import {
sendMessageAsUser,
getBiasStrings,
saveChatConditional,
deactivateSendButtons,
activateSendButtons,
} from "../script.js";
import { appendTagToList, createTagMapFromList, getTagsList, applyTagsOnCharacterSelect } from './tags.js';
@ -517,13 +519,14 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
.find(".typing_indicator_name")
.text(characters[chId].name);
$("#chat").append(typingIndicator);
typingIndicator.show(250, function () {
typingIndicator.show(200, function () {
typingIndicator.get(0).scrollIntoView({ behavior: "smooth" });
});
}
// TODO: This is awful. Refactor this
while (true) {
deactivateSendButtons();
if (isGenerationAborted) {
throw new Error('Group generation aborted');
}
@ -607,7 +610,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
}
} finally {
// hide and reapply the indicator to the bottom of the list
typingIndicator.hide(250);
typingIndicator.hide(200);
$("#chat").append(typingIndicator);
is_group_generating = false;
@ -615,6 +618,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
setSendButtonState(false);
setCharacterId(undefined);
setCharacterName('');
activateSendButtons();
showSwipeButtons();
}
}