diff --git a/src/components/Chat/ChatContent/Message/MessageContent.tsx b/src/components/Chat/ChatContent/Message/MessageContent.tsx index 4e1b341..a6f7e7d 100644 --- a/src/components/Chat/ChatContent/Message/MessageContent.tsx +++ b/src/components/Chat/ChatContent/Message/MessageContent.tsx @@ -128,7 +128,7 @@ const ContentView = React.memo( return ( <> -
+
{ const chats = useStore.getState().chats; const currentChatIndex = useStore.getState().currentChatIndex; if (chats) { - const items: ShareGPTSubmitBodyInterface['items'] = chats[ - currentChatIndex - ].messages.map((message) => ({ - from: 'gpt', - value: `

${t(message.role)}

${message.content}`, - })); try { + const items: ShareGPTSubmitBodyInterface['items'] = []; + const messages = document.querySelectorAll('.share-gpt-message'); + + messages.forEach((message, index) => { + items.push({ + from: 'gpt', + value: `

${t( + chats[currentChatIndex].messages[index].role + )}

${message.innerHTML}`, + }); + }); + await submitShareGPT({ avatarUrl: '', items,