chore: make updateAnswer also effect error

This commit is contained in:
josc146
2023-03-31 19:20:19 +08:00
parent 82c53de79d
commit e3e235cd4a
+1 -1
View File
@@ -97,7 +97,7 @@ function ConversationCard(props) {
const updateAnswer = (value, appended, newType, done = false) => {
setConversationItemData((old) => {
const copy = [...old]
const index = copy.findLastIndex((v) => v.type === 'answer')
const index = copy.findLastIndex((v) => v.type === 'answer' || v.type === 'error')
if (index === -1) return copy
copy[index] = new ConversationItemData(
newType,