Fix swipes and thumbnails for groups

This commit is contained in:
SillyLossy
2023-03-27 20:00:14 +03:00
parent d18f005268
commit b3d992baee
2 changed files with 9 additions and 2 deletions

View File

@ -102,6 +102,8 @@ export {
saveChat, saveChat,
messageFormating, messageFormating,
getExtensionPrompt, getExtensionPrompt,
showSwipeButtons,
hideSwipeButtons,
chat, chat,
this_chid, this_chid,
settings, settings,
@ -1722,7 +1724,7 @@ async function Generate(type, automatic_trigger, force_name2) {//encode("dsfs").
console.log('entering chat update for groups'); console.log('entering chat update for groups');
let avatarImg = 'img/ai4.png'; let avatarImg = 'img/ai4.png';
if (characters[this_chid].avatar != 'none') { if (characters[this_chid].avatar != 'none') {
avatarImg = `characters/${characters[this_chid].avatar}?${Date.now()}`; avatarImg = `/thumbnail?type=avatar&file=${encodeURIComponent(characters[this_chid].avatar)}&${Date.now()}`;
} }
chat[chat.length - 1]['is_name'] = true; chat[chat.length - 1]['is_name'] = true;
chat[chat.length - 1]['force_avatar'] = avatarImg; chat[chat.length - 1]['force_avatar'] = avatarImg;
@ -2770,7 +2772,8 @@ function showSwipeButtons() {
!swipes || !swipes ||
$('.mes:last').attr('mesid') <= 0 || $('.mes:last').attr('mesid') <= 0 ||
chat[chat.length - 1].is_user || chat[chat.length - 1].is_user ||
count_view_mes <= 1 count_view_mes <= 1 ||
(selected_group && is_group_generating)
) { return; } ) { return; }
//had to add this to make the swipe counter work //had to add this to make the swipe counter work

View File

@ -33,6 +33,8 @@ import {
setRightTabSelectedClass, setRightTabSelectedClass,
default_ch_mes, default_ch_mes,
deleteLastMessage, deleteLastMessage,
showSwipeButtons,
hideSwipeButtons,
} from "../script.js"; } from "../script.js";
export { export {
@ -267,6 +269,7 @@ async function generateGroupWrapper(by_auto_mode, type=null) {
} }
try { try {
hideSwipeButtons();
is_group_generating = true; is_group_generating = true;
setCharacterName(''); setCharacterName('');
setCharacterId(undefined); setCharacterId(undefined);
@ -339,6 +342,7 @@ async function generateGroupWrapper(by_auto_mode, type=null) {
setSendButtonState(false); setSendButtonState(false);
setCharacterId(undefined); setCharacterId(undefined);
setCharacterName(''); setCharacterName('');
showSwipeButtons();
} }
} }