mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Use EventEmitter instead of native event handling
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
menu_type,
|
||||
max_context,
|
||||
saveSettingsDebounced,
|
||||
eventSource,
|
||||
active_group,
|
||||
active_character,
|
||||
setActiveGroup,
|
||||
@@ -924,6 +925,16 @@ $("document").ready(function () {
|
||||
$(document).on("click", ".character_select", function () {
|
||||
setActiveCharacter($(this).find('.avatar').attr('title'));
|
||||
setActiveGroup(null);
|
||||
|
||||
const chid = $(this).attr('chid');
|
||||
eventSource.emit(
|
||||
'characterSelected',
|
||||
{detail: {id: chid, character: characters[chid]}})
|
||||
.then(r => {
|
||||
SaveLocal('ActiveChar', chid);
|
||||
SaveLocal('ActiveGroup', null);
|
||||
});
|
||||
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user