fixed bug w/ keyboard swipes going while swipes disabled

This commit is contained in:
RossAsscends
2023-03-20 16:47:10 +09:00
parent c1cd609ade
commit 3dc13ee272
2 changed files with 12 additions and 10 deletions

View File

@ -1016,7 +1016,7 @@ async function Generate(type, automatic_trigger) {//encode("dsfs").length
} else { } else {
chat.length = chat.length - 1; chat.length = chat.length - 1;
count_view_mes -= 1; count_view_mes -= 1;
$('#chat').children().last().hide(500, function() { $('#chat').children().last().hide(500, function () {
$(this).remove(); $(this).remove();
}); });
} }
@ -1127,11 +1127,11 @@ async function Generate(type, automatic_trigger) {//encode("dsfs").length
if (pin_examples) { if (pin_examples) {
for (let example of mesExamplesArray) { for (let example of mesExamplesArray) {
if(!is_pygmalion) { if (!is_pygmalion) {
if (!storyString.endsWith('\n')) { if (!storyString.endsWith('\n')) {
storyString += '\n'; storyString += '\n';
} }
example = example.replace(/<START>/i, 'This is how '+name2+' should talk');//An example of how '+name2+' responds example = example.replace(/<START>/i, 'This is how ' + name2 + ' should talk');//An example of how '+name2+' responds
} }
storyString += appendToStoryString(example, ''); storyString += appendToStoryString(example, '');
} }
@ -1398,7 +1398,7 @@ async function Generate(type, automatic_trigger) {//encode("dsfs").length
var generate_data; var generate_data;
if (main_api == 'kobold') { if (main_api == 'kobold') {
var generate_data = { var generate_data = {
prompt: finalPromt, prompt: finalPromt,
gui_settings: true, gui_settings: true,
max_length: amount_gen, max_length: amount_gen,
@ -2913,7 +2913,7 @@ $(document).ready(function () {
const swipe_range = '700px'; const swipe_range = '700px';
chat[chat.length - 1]['swipe_id']--; chat[chat.length - 1]['swipe_id']--;
if (chat[chat.length - 1]['swipe_id'] >= 0) { // hide the left arrow if we are viewing the first candidate of the last message block if (chat[chat.length - 1]['swipe_id'] >= 0) { // hide the left arrow if we are viewing the first candidate of the last message block
$(this).parent().children('swipe_right_button').css('display', 'flex'); $(this).parent().children('swipe_right').css('display', 'flex');
if (chat[chat.length - 1]['swipe_id'] === 0) { if (chat[chat.length - 1]['swipe_id'] === 0) {
$(this).css('display', 'none'); $(this).css('display', 'none');
} }
@ -3672,7 +3672,7 @@ $(document).ready(function () {
else if (id == "option_regenerate") { else if (id == "option_regenerate") {
if (is_send_press == false) { if (is_send_press == false) {
//hideSwipeButtons(); //hideSwipeButtons();
if (selected_group) { if (selected_group) {
regenerateGroup(); regenerateGroup();
} }

View File

@ -13,7 +13,7 @@ import {
} from "../script.js"; } from "../script.js";
import { import {
pin_examples, pin_examples,
} from "./power-user.js"; } from "./power-user.js";
import { LoadLocal, SaveLocal, ClearLocal, CheckLocal, LoadLocalBool } from "./f-localStorage.js"; import { LoadLocal, SaveLocal, ClearLocal, CheckLocal, LoadLocalBool } from "./f-localStorage.js";
@ -146,7 +146,7 @@ function RA_CountCharTokens() {
characters[this_chid].description + characters[this_chid].description +
characters[this_chid].personality + characters[this_chid].personality +
characters[this_chid].scenario + characters[this_chid].scenario +
(pin_examples ? characters[this_chid].mes_example : '') // add examples to permanent if they are pinned (pin_examples ? characters[this_chid].mes_example : '') // add examples to permanent if they are pinned
)).length; )).length;
} else { console.log("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading } else { console.log("RA_TC -- no valid char found, closing."); } // if neither, probably safety char or some error in loading
} }
@ -333,8 +333,9 @@ $("document").ready(function () {
$("#character_popup").css("display") + ' ' + $("#character_popup").css("display") + ' ' +
$("#shadow_select_chat_popup").css("display") + ' ' + $("#shadow_select_chat_popup").css("display") + ' ' +
isInputElementInFocus()); */ isInputElementInFocus()); */
if ( if (
$(".swipe_left:last").css("display") === "flex" &&
$("#send_textarea").val() === '' && $("#send_textarea").val() === '' &&
$("#character_popup").css("display") === "none" && $("#character_popup").css("display") === "none" &&
$("#shadow_select_chat_popup").css("display") === "none" && $("#shadow_select_chat_popup").css("display") === "none" &&
@ -349,8 +350,9 @@ $("document").ready(function () {
$("#character_popup").css("display") + ' ' + $("#character_popup").css("display") + ' ' +
$("#shadow_select_chat_popup").css("display") + ' ' + $("#shadow_select_chat_popup").css("display") + ' ' +
isInputElementInFocus()); */ isInputElementInFocus()); */
if ( if (
$(".swipe_right:last").css("display") === "flex" &&
$("#send_textarea").val() === '' && $("#send_textarea").val() === '' &&
$("#character_popup").css("display") === "none" && $("#character_popup").css("display") === "none" &&
$("#shadow_select_chat_popup").css("display") === "none" && $("#shadow_select_chat_popup").css("display") === "none" &&