{$i18n.t('Chat History is off for this browser.')}
{$i18n.t(
"When history is turned off, new chats on this browser won't appear in your history on any of your devices."
)}
{$i18n.t('This setting does not sync across browsers or devices.')}
{/if}
{
enrichChatsWithContent($chats);
}}
/>
{#if $tags.length > 0}
{#each $tags as tag}
{/each}
{/if}
{#each $chats.filter((chat) => {
if (search === '') {
return true;
} else {
let title = chat.title.toLowerCase();
const query = search.toLowerCase();
let contentMatches = false;
// Access the messages within chat.chat.messages
if (chat.chat && chat.chat.messages && Array.isArray(chat.chat.messages)) {
contentMatches = chat.chat.messages.some((message) => {
// Check if message.content exists and includes the search query
return message.content && message.content.toLowerCase().includes(query);
});
}
return title.includes(query) || contentMatches;
}
}) as chat, i}