{ // disable automatic scrolling is user initiates scroll if (!isProgrammaticScroll) { shouldScrollToBottom = false; } isProgrammaticScroll = false; }} > {#if !viewCode} {#each conversation.messages as message, messageIdx} dispatch("deleteMessage", messageIdx)} autofocus={!loading && messageIdx === conversation.messages.length - 1} /> {/each} {:else} {/if}