diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 3ef99594e..68cb985b6 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -309,31 +309,33 @@ copyToClipboard={copyToClipboardWithToast} /> {:else} - { - console.log('save', e); + {#key message.id} + { + console.log('save', e); - const message = e.detail; - history.messages[message.id] = message; - await updateChatById(localStorage.token, chatId, { - messages: messages, - history: history - }); - }} - /> + const message = e.detail; + history.messages[message.id] = message; + await updateChatById(localStorage.token, chatId, { + messages: messages, + history: history + }); + }} + /> + {/key} {/if} diff --git a/src/lib/components/chat/Messages/RateComment.svelte b/src/lib/components/chat/Messages/RateComment.svelte index 2c6d3608e..895143e02 100644 --- a/src/lib/components/chat/Messages/RateComment.svelte +++ b/src/lib/components/chat/Messages/RateComment.svelte @@ -39,9 +39,9 @@ let selectedReason = null; let comment = ''; - $: if (message.annotation.rating === 1) { + $: if (message?.annotation?.rating === 1) { reasons = LIKE_REASONS; - } else if (message.annotation.rating === -1) { + } else if (message?.annotation?.rating === -1) { reasons = DISLIKE_REASONS; } diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 5b228a9ff..0b7c5e876 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -65,8 +65,8 @@ let generatingImage = false; let showRateComment = false; - let showCitationModal = false; + let selectedCitation = null; $: tokens = marked.lexer(sanitizeResponseContent(message.content)); @@ -902,7 +902,7 @@ {/if} - {#if showRateComment} + {#if message.done && showRateComment}