Merge pull request #185 from Webifi/main

Fix issue with messages getting mixed up
This commit is contained in:
Niek van der Maas 2023-06-17 05:29:50 +02:00 committed by GitHub
commit 9983290fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -33,9 +33,7 @@
faMicrophone, faMicrophone,
faLightbulb, faLightbulb,
faCommentSlash, faCommentSlash,
faCircleCheck faCircleCheck
} from '@fortawesome/free-solid-svg-icons/index' } from '@fortawesome/free-solid-svg-icons/index'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import { getPrice } from './Stats.svelte' import { getPrice } from './Stats.svelte'
@ -50,11 +48,6 @@
const chatId: number = parseInt(params.chatId) const chatId: number = parseInt(params.chatId)
let chatRequest = new ChatRequest() let chatRequest = new ChatRequest()
// let controller:AbortController
// let updating: boolean|number = false
// let updatingMessage: string = ''
let input: HTMLTextAreaElement let input: HTMLTextAreaElement
let recognition: any = null let recognition: any = null
let recording = false let recording = false
@ -98,6 +91,12 @@
$: onStateChange($checkStateChange, $showSetChatSettings, $submitExitingPromptsNow, $continueMessage) $: onStateChange($checkStateChange, $showSetChatSettings, $submitExitingPromptsNow, $continueMessage)
const afterChatLoad = (...args:any) => {
scrollToBottom()
}
$: afterChatLoad($currentChatId)
setCurrentChat(0) setCurrentChat(0)
// Make sure chat object is ready to go // Make sure chat object is ready to go
updateChatSettings(chatId) updateChatSettings(chatId)

View File

@ -14,6 +14,6 @@
{#each messages as message, i} {#each messages as message, i}
{#if !((message.summarized) && $globalStorage.hideSummarized) && !(i === 0 && message.role === 'system' && !chatSettings.useSystemPrompt)} {#if !((message.summarized) && $globalStorage.hideSummarized) && !(i === 0 && message.role === 'system' && !chatSettings.useSystemPrompt)}
<EditMessage bind:message={message} chatId={chatId} chat={chat} /> {#key message.uuid}<EditMessage bind:message={message} chatId={chatId} chat={chat} />{/key}
{/if} {/if}
{/each} {/each}