toast and highlight for new group creation

This commit is contained in:
RossAscends
2023-05-25 01:14:19 +09:00
parent ae374510c1
commit 4240f34dcb
2 changed files with 15 additions and 9 deletions

View File

@ -2276,7 +2276,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
} catch (error) {
onError(error);
}
}
}
//set array object for prompt token itemization of this message
let currentArrayEntry = Number(thisPromptBits.length - 1);
@ -4232,6 +4232,9 @@ function select_rm_info(type, charId, previousCharId = null) {
if (type === 'char_create') {
toastr.success(`Character Created: ${charId}`);
}
if (type === 'group_create') {
toastr.success(`Group Created`);
}
if (type === 'char_import') {
toastr.success(`Character Imported: ${charId}`);
}
@ -4250,6 +4253,16 @@ function select_rm_info(type, charId, previousCharId = null) {
}, 5000);
}
if (type === 'group_create') {
//for groups, ${charId} = data.id from group-chats.js createGroup()
const element = $(`#rm_characters_block [grid="${charId}"]`).get(0);
element.scrollIntoView({ behavior: 'smooth', block: 'end' });
$(`#rm_characters_block [grid="${charId}"]`).addClass('flash animated');
setTimeout(function () {
$(`#rm_characters_block [grid="${charId}"]`).removeClass('flash animated');
}, 5000);
}
setRightTabSelectedClass();
if (previousCharId) {

View File

@ -1133,15 +1133,8 @@ async function createGroup() {
if (createGroupResponse.ok) {
const data = await createGroupResponse.json();
createTagMapFromList("#groupTagList", data.id);
await getCharacters();
$("#rm_info_avatar").html("");
const avatar = $("#avatar_div_div").clone();
avatar.find("img").attr("src", avatar_url);
$("#rm_info_avatar").append(avatar);
$("#rm_info_block").transition({ opacity: 0, duration: 0 });
select_rm_info("Group chat created");
$("#rm_info_block").transition({ opacity: 1.0, duration: 2000 });
select_rm_info('group_create', data.id);
}
}