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