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'); 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; is_send_press = false;
$("#send_but").css("display", "flex"); $("#send_but").css("display", "flex");
$("#send_textarea").attr("disabled", false); $("#send_textarea").attr("disabled", false);
hideStopButton(); hideStopButton();
} }
function deactivateSendButtons() { export function deactivateSendButtons() {
$("#send_but").css("display", "none"); $("#send_but").css("display", "none");
showStopButton(); showStopButton();
} }

View File

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