{#if messages.length == 0}
{:else}
{#key chatId} {#each messages as message, messageIdx}
{#if message.role === 'user'}
message.parentId === null) .map((message) => message.id) ?? []} {confirmEditMessage} {showPreviousMessage} {showNextMessage} {copyToClipboard} /> {#if messages.length - 1 === messageIdx && processing !== ''}
{processing}
{/if} {:else}
{ console.log('save', e); const message = e.detail; history.messages[message.id] = message; await updateChatById(localStorage.token, chatId, { messages: messages, history: history }); }} /> {/if}
{/each} {#if bottomPadding}
{/if} {/key}
{/if}