mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-03 07:42:49 +08:00
fix repeated prompt when completing an answer and clicking the retry button (#400)
This commit is contained in:
@@ -211,6 +211,15 @@ function ConversationCard(props) {
|
||||
updateAnswer(`<p class="gpt-loading">${t('Waiting for response...')}</p>`, false, 'answer')
|
||||
setIsReady(false)
|
||||
|
||||
if (session.conversationRecords.length > 0) {
|
||||
const lastRecord = session.conversationRecords[session.conversationRecords.length - 1]
|
||||
if (
|
||||
conversationItemData[conversationItemData.length - 1].done &&
|
||||
lastRecord.question === conversationItemData[conversationItemData.length - 2].content
|
||||
) {
|
||||
session.conversationRecords.pop()
|
||||
}
|
||||
}
|
||||
const newSession = { ...session, isRetry: true }
|
||||
setSession(newSession)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user