Filter out undefined messages for past chats search

This commit is contained in:
Cohee 2023-09-12 18:05:37 +03:00
parent 2f8f6844fe
commit 6c29879f12
1 changed files with 1 additions and 1 deletions

View File

@ -5319,7 +5319,7 @@ export async function displayPastChats() {
const fileName = chat['file_name'];
const chatContent = rawChats[fileName];
return chatContent && Object.values(chatContent).some(message => message.mes.toLowerCase().includes(searchQuery.toLowerCase()));
return chatContent && Object.values(chatContent).some(message => message?.mes?.toLowerCase()?.includes(searchQuery.toLowerCase()));
});
console.log(filteredData);