Smart refresh thumbnails cache. Sort group candidates list. Remove members by click on remove btn

This commit is contained in:
SillyLossy
2023-04-14 19:44:59 +03:00
parent 4b98f9d825
commit 81bffd34d8
7 changed files with 101 additions and 36 deletions

View File

@ -69,7 +69,9 @@ async function moduleWorker() {
// check if last message changed
const currentLastMessage = getLastCharacterMessage();
if (lastCharacter === context.characterId && lastMessage === currentLastMessage.mes && $('img.expression').attr('src')) {
if ((lastCharacter === context.characterId || lastCharacter === context.groupId)
&& lastMessage === currentLastMessage.mes
&& $('img.expression').attr('src')) {
return;
}
@ -198,6 +200,12 @@ async function setExpression(character, expression, force) {
const debugImageStatus = document.querySelector(`#image_list div[id="${filename}"] span`);
const img = $('img.expression');
if (!debugImageStatus && !force) {
validateImages();
setTimeout(() => setExpression(character, expression, true), 500);
return;
}
if (force || (debugImageStatus && !debugImageStatus.classList.contains('failure'))) {
//console.log('setting expression from character images folder');
const imgUrl = `/characters/${character}/${filename}`;