Update "active character" field on char rename
| @@ -6263,6 +6263,12 @@ export async function renameCharacter(name = null, { silent = false, renameChats | ||
| 6263 | 6263 | saveSettingsDebounced(); |
| 6264 | 6264 | } |
| 6265 | 6265 | |
| 6266 | + // Update active character, if the current one was the currently active one | |
| 6267 | + if (active_character === oldAvatar) { | |
| 6268 | + active_character = newAvatar; | |
| 6269 | + saveSettingsDebounced(); | |
| 6270 | + } | |
| 6271 | + | |
| 6266 | 6272 | eventSource.emit(event_types.CHARACTER_RENAMED, oldAvatar, newAvatar); |
| 6267 | 6273 | |
| 6268 | 6274 | // Reload characters list |