From 8d2c8fd67546c0c8a44d8375fe171ecaf084ace9 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 12 May 2025 00:53:33 +0300 Subject: [PATCH] Prevent reopening an already open recent chat --- public/scripts/welcome-screen.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/scripts/welcome-screen.js b/public/scripts/welcome-screen.js index 09ecee035..8c193b838 100644 --- a/public/scripts/welcome-screen.js +++ b/public/scripts/welcome-screen.js @@ -72,6 +72,11 @@ async function openRecentChat(avatarId, fileName) { try { await selectCharacterById(characterId); + const currentChatId = getCurrentChatId(); + if (currentChatId === fileName) { + console.debug(`Chat ${fileName} is already open.`); + return; + } await openCharacterChat(fileName); } catch (error) { console.error('Error opening recent chat:', error);