From 1b570bf16f2cf1313cd29073f9f5402f9bb3e913 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 27 Jul 2024 20:37:14 +0300 Subject: [PATCH] Fix empty chats not showing in chat manager --- public/script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/script.js b/public/script.js index 1dd8599c2..08b6aeee0 100644 --- a/public/script.js +++ b/public/script.js @@ -6816,6 +6816,11 @@ export async function displayPastChats() { const fileName = chat['file_name']; const chatContent = rawChats[fileName]; + // Make sure empty chats are displayed when there is no search query + if (Array.isArray(chatContent) && !chatContent.length && !searchQuery) { + return true; + } + // // Uncomment this to return to old behavior (classical full-substring search). // return chatContent && Object.values(chatContent).some(message => message?.mes?.toLowerCase()?.includes(searchQuery.toLowerCase()));