Commit fe362805 by weiyudumei

fix: 修复 workflow 卡片初始化时被禁用的问题

- 移除 ChatAnswerParser 中未定义的 fromParser prop,修复 isAsking is not defined 错误
- 修改 workflow 卡片的 isCompleted 判断逻辑,仅当有后续回答时才禁用表单
- 避免从历史记录加载时误禁用 workflow 表单
- 修复 ESLint 未使用变量警告
parent 8b048818
......@@ -28,7 +28,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({
onSubmitQuestion,
onWorkflowSubmit,
isWorkflowSubmitting = false,
isAsking = false,
isAsking: _isAsking = false,
}) => {
const [previewModalOpen, setPreviewModalOpen] = useState(false)
const [currentDoc, setCurrentDoc] = useState<any>(null)
......@@ -177,7 +177,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({
answer={answer}
onSubmitWorkflow={onWorkflowSubmit || (() => {})}
isSubmitting={isWorkflowSubmitting}
isCompleted={isLastAnswer && answer.endAnswerFlag === true && !isAsking}
isCompleted={!isLastAnswer}
/>
)}
{/* 其他 card-* 类型 */}
......
......@@ -207,7 +207,6 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
&& answer.cardList?.length !== 0
&& (
<ChatAnswerAttachment
fromParser
isLastAnswer={isLastAnswer}
onSubmitQuestion={onSubmitQuestion}
answer={answer}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment