fixed charlist visibility for autoloadchat

This commit is contained in:
RossAscends
2023-05-22 05:40:25 +09:00
parent 48da2727af
commit 0e7289d878
2 changed files with 17 additions and 10 deletions

View File

@ -812,7 +812,11 @@ function printCharacters() {
printGroups(); printGroups();
sortCharactersList(); sortCharactersList();
favsToHotswap(); favsToHotswap();
setTimeout(function () {
updateVisibleDivs(); updateVisibleDivs();
}, 1000);
$("#rm_print_characters_block").on('scroll',
debounce(updateVisibleDivs, 50));
} }
async function getCharacters() { async function getCharacters() {
@ -1193,7 +1197,7 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
// don't need prompt button for user // don't need prompt button for user
if (params.isUser === true) { if (params.isUser === true) {
newMessage.find(".mes_prompt").hide(); newMessage.find(".mes_prompt").hide();
console.log(`hiding prompt for user mesID ${params.mesId}`); //console.log(`hiding prompt for user mesID ${params.mesId}`);
} }
//shows or hides the Prompt display button //shows or hides the Prompt display button
@ -1211,10 +1215,12 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
} }
} }
} else if (params.isUser !== true) { //hide all when prompt cache is empty } else if (params.isUser !== true) { //hide all when prompt cache is empty
console.log('saw empty prompt cache, hiding all prompt buttons'); //console.log('saw empty prompt cache, hiding all prompt buttons');
$(".mes_prompt").hide(); $(".mes_prompt").hide();
//console.log(itemizedPrompts); //console.log(itemizedPrompts);
} else { console.log('skipping prompt data for User Message'); } } else {
//console.log('skipping prompt data for User Message');
}
newMessage.find('.avatar img').on('error', function () { newMessage.find('.avatar img').on('error', function () {
$(this).hide(); $(this).hide();
@ -4278,6 +4284,7 @@ function select_rm_characters() {
menu_type = "characters"; menu_type = "characters";
selectRightMenuWithAnimation('rm_characters_block'); selectRightMenuWithAnimation('rm_characters_block');
setRightTabSelectedClass('rm_button_characters'); setRightTabSelectedClass('rm_button_characters');
updateVisibleDivs();
} }
function setExtensionPrompt(key, value, position, depth) { function setExtensionPrompt(key, value, position, depth) {
@ -6224,10 +6231,6 @@ $(document).ready(function () {
showSwipeButtons(); showSwipeButtons();
}); });
setTimeout(function () {
$("#rm_print_characters_block").on('scroll',
debounce(updateVisibleDivs, 50));
}, 3000)
$(document).on("click", ".mes_edit_delete", function () { $(document).on("click", ".mes_edit_delete", function () {
if (!confirm("Are you sure you want to delete this message?")) { if (!confirm("Are you sure you want to delete this message?")) {

View File

@ -276,8 +276,12 @@ async function RA_autoloadchat() {
if (document.getElementById('CharID0') !== null) { if (document.getElementById('CharID0') !== null) {
var charToAutoLoad = document.getElementById('CharID' + LoadLocal('ActiveChar')); var charToAutoLoad = document.getElementById('CharID' + LoadLocal('ActiveChar'));
let groupToAutoLoad = document.querySelector(`.group_select[grid="${LoadLocal('ActiveGroup')}"]`); let groupToAutoLoad = document.querySelector(`.group_select[grid="${LoadLocal('ActiveGroup')}"]`);
if (charToAutoLoad != null) { $(charToAutoLoad).click(); } if (charToAutoLoad != null) {
else if (groupToAutoLoad != null) { $(groupToAutoLoad).click(); } $(charToAutoLoad).click();
}
else if (groupToAutoLoad != null) {
$(groupToAutoLoad).click();
}
// if the charcter list hadn't been loaded yet, try again. // if the charcter list hadn't been loaded yet, try again.
} else { setTimeout(RA_autoloadchat, 100); } } else { setTimeout(RA_autoloadchat, 100); }