{#if messages.at(0)?.parentId !== null}
{
console.log('visible');
if (!messagesLoading) {
loadMoreMessages();
}
}}
>
{/if}
{#each messages as message, messageIdx (message.id)}
{
if (autoScroll) {
const element = document.getElementById('messages-container');
autoScroll =
element.scrollHeight - element.scrollTop <= element.clientHeight + 50;
setTimeout(() => {
scrollToBottom();
}, 100);
}
}}
/>
{/each}