Fix empty chats not showing in chat manager

This commit is contained in:
Cohee 2024-07-27 20:37:14 +03:00
parent 5ad433c576
commit 1b570bf16f
1 changed files with 5 additions and 0 deletions

View File

@ -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()));