Prevent reopening an already open recent chat
| @@ -72,6 +72,11 @@ async function openRecentChat(avatarId, fileName) { | |||
| 72 | 72 | ||
| 73 | try { | 73 | try { |
| 74 | await selectCharacterById(characterId); | 74 | await selectCharacterById(characterId); |
| 75 | const currentChatId = getCurrentChatId(); | ||
| 76 | if (currentChatId === fileName) { | ||
| 77 | console.debug(`Chat ${fileName} is already open.`); | ||
| 78 | return; | ||
| 79 | } | ||
| 75 | await openCharacterChat(fileName); | 80 | await openCharacterChat(fileName); |
| 76 | } catch (error) { | 81 | } catch (error) { |
| 77 | console.error('Error opening recent chat:', error); | 82 | console.error('Error opening recent chat:', error); |