mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
toast and highlight for new group creation
This commit is contained in:
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user