mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Update "active character" field on char rename
This commit is contained in:
@ -6263,6 +6263,12 @@ export async function renameCharacter(name = null, { silent = false, renameChats
|
|||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update active character, if the current one was the currently active one
|
||||||
|
if (active_character === oldAvatar) {
|
||||||
|
active_character = newAvatar;
|
||||||
|
saveSettingsDebounced();
|
||||||
|
}
|
||||||
|
|
||||||
eventSource.emit(event_types.CHARACTER_RENAMED, oldAvatar, newAvatar);
|
eventSource.emit(event_types.CHARACTER_RENAMED, oldAvatar, newAvatar);
|
||||||
|
|
||||||
// Reload characters list
|
// Reload characters list
|
||||||
|
Reference in New Issue
Block a user