Update "active character" field on char rename

This commit is contained in:
Wolfsblvt 2025-02-17 05:34:28 +01:00
parent 4f0921856f
commit 1c0ca414b9

View File

@ -6263,6 +6263,12 @@ export async function renameCharacter(name = null, { silent = false, renameChats
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);
// Reload characters list