| 6816 | 6816 | const fileName = chat['file_name']; |
| 6817 | 6817 | const chatContent = rawChats[fileName]; |
| 6818 | 6818 | |
| 6819 | + // Make sure empty chats are displayed when there is no search query |
| 6820 | + if (Array.isArray(chatContent) && !chatContent.length && !searchQuery) { |
| 6821 | + return true; |
| 6822 | + } |
| 6823 | + |
| 6819 | 6824 | // // Uncomment this to return to old behavior (classical full-substring search). |
| 6820 | 6825 | // return chatContent && Object.values(chatContent).some(message => message?.mes?.toLowerCase()?.includes(searchQuery.toLowerCase())); |
| 6821 | 6826 | |