Fix auto-load chat when opening from welcome screen
| @@ -18,7 +18,10 @@ import { | |||
| 18 | openCharacterChat, | 18 | openCharacterChat, |
| 19 | printCharactersDebounced, | 19 | printCharactersDebounced, |
| 20 | renameGroupOrCharacterChat, | 20 | renameGroupOrCharacterChat, |
| 21 | saveSettingsDebounced, | ||
| 21 | selectCharacterById, | 22 | selectCharacterById, |
| 23 | setActiveCharacter, | ||
| 24 | setActiveGroup, | ||
| 22 | system_avatar, | 25 | system_avatar, |
| 23 | system_message_types, | 26 | system_message_types, |
| 24 | this_chid, | 27 | this_chid, |
| @@ -296,6 +299,8 @@ async function openRecentCharacterChat(avatarId, fileName) { | |||
| 296 | 299 | ||
| 297 | try { | 300 | try { |
| 298 | await selectCharacterById(characterId); | 301 | await selectCharacterById(characterId); |
| 302 | setActiveCharacter(avatarId); | ||
| 303 | saveSettingsDebounced(); | ||
| 299 | const currentChatId = getCurrentChatId(); | 304 | const currentChatId = getCurrentChatId(); |
| 300 | if (currentChatId === fileName) { | 305 | if (currentChatId === fileName) { |
| 301 | console.debug(`Chat ${fileName} is already open.`); | 306 | console.debug(`Chat ${fileName} is already open.`); |
| @@ -322,6 +327,8 @@ async function openRecentGroupChat(groupId, fileName) { | |||
| 322 | 327 | ||
| 323 | try { | 328 | try { |
| 324 | await openGroupById(groupId); | 329 | await openGroupById(groupId); |
| 330 | setActiveGroup(groupId); | ||
| 331 | saveSettingsDebounced(); | ||
| 325 | const currentChatId = getCurrentChatId(); | 332 | const currentChatId = getCurrentChatId(); |
| 326 | if (currentChatId === fileName) { | 333 | if (currentChatId === fileName) { |
| 327 | console.debug(`Chat ${fileName} is already open.`); | 334 | console.debug(`Chat ${fileName} is already open.`); |