diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 653bb0ae9d..5a17221ecd 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -569,13 +569,16 @@ console.log(tags); if (tags) { - updatedMessage.annotation.tags = tags; - feedbackItem.data.tags = tags; + const taggedMessage = { + ...message, + annotation: { ...(message?.annotation ?? {}), tags: tags } + }; + feedbackItem.data = { ...feedbackItem.data, ...taggedMessage.annotation }; - saveMessage(message.id, updatedMessage); + saveMessage(message.id, taggedMessage); await updateFeedbackById( localStorage.token, - updatedMessage.feedbackId, + taggedMessage.feedbackId, feedbackItem ).catch((error) => { toast.error(`${error}`);