mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Prevent reopening an already open recent chat
This commit is contained in:
@@ -72,6 +72,11 @@ async function openRecentChat(avatarId, fileName) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await selectCharacterById(characterId);
|
await selectCharacterById(characterId);
|
||||||
|
const currentChatId = getCurrentChatId();
|
||||||
|
if (currentChatId === fileName) {
|
||||||
|
console.debug(`Chat ${fileName} is already open.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await openCharacterChat(fileName);
|
await openCharacterChat(fileName);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error opening recent chat:', error);
|
console.error('Error opening recent chat:', error);
|
||||||
|
Reference in New Issue
Block a user