diff --git a/public/script.js b/public/script.js index 760fd34d5..107ede82c 100644 --- a/public/script.js +++ b/public/script.js @@ -2677,12 +2677,23 @@ function read_bg_load(input) { function showSwipeButtons() { if ( - chat[chat.length - 1].name === 'TavernAI' || + chat[chat.length - 1].is_system || !swipes || $('.mes:last').attr('mesid') <= 0 || chat[chat.length - 1].is_user || count_view_mes <= 1 ) { return; } + + //had to add this to make the swipe counter work + //(copied from the onclick functions for swipe buttons.. + //don't know why the array isn't set for non-swipe messsages in Generate or addOneMessage..) + + if (chat[chat.length - 1]['swipe_id'] === undefined) { // if there is no swipe-message in the last spot of the chat array + chat[chat.length - 1]['swipe_id'] = 0; // set it to id 0 + chat[chat.length - 1]['swipes'] = []; // empty the array + chat[chat.length - 1]['swipes'][0] = chat[chat.length - 1]['mes']; //assign swipe array with last message from chat + } + const currentMessage = $("#chat").children().filter(`[mesid="${count_view_mes - 1}"]`); const swipeId = chat[chat.length - 1].swipe_id; var swipesCounterHTML = (`${(swipeId + 1)}/${(chat[chat.length - 1].swipes.length)}`); @@ -2694,16 +2705,6 @@ function showSwipeButtons() { currentMessage.children('.swipe_right').css('display', 'flex'); currentMessage.children('.swipe_right').css('opacity', '0.3'); } - - //had to add this to make the swipe counter work - //(copied from the onclick functions for swipe buttons.. - //don't know why the array isn't set for non-swipe messsages in Generate or addOneMessage..) - - if (chat[chat.length - 1]['swipe_id'] === undefined) { // if there is no swipe-message in the last spot of the chat array - chat[chat.length - 1]['swipe_id'] = 0; // set it to id 0 - chat[chat.length - 1]['swipes'] = []; // empty the array - chat[chat.length - 1]['swipes'][0] = chat[chat.length - 1]['mes']; //assign swipe array with last message from chat - } //console.log((chat[chat.length - 1])); if (is_send_press === false && (chat[chat.length - 1].swipes.length - swipeId) === 1) { console.log('highlighting R swipe'); diff --git a/public/style.css b/public/style.css index 2a795f0ff..04da316e5 100644 --- a/public/style.css +++ b/public/style.css @@ -384,9 +384,9 @@ code { color: var(--ivory, white); */ } -.last_mes .mes_text { +/*.last_mes .mes_text { min-height: 10em; -} +}*/ .last_mes{ grid-template-columns: [checkbox] fit-content(60px) [avatar] 50px [msg_block] auto [rightswipe] fit-content(48px);