fix: 修复占位图不消失的问题

只用 isGeneratingImageFlag 来控制生图占位图的显示,
不再检查消息中的 GENERATING_IMAGE 标记,
因为该标记会一直存在于消息中

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Your Name 2026-02-01 10:44:48 +08:00
parent 2fc702b543
commit 52286c40f8

View File

@ -439,11 +439,12 @@ function PureMessages({
// 🆕 智能自动模式占位图
if (isAutoMode && userMessageHasImage) {
// 如果已经收到了 GENERATING_IMAGE 标记 或 isGeneratingImageFlag 为 true,显示生图占位图
if (hasGeneratingMarker || isGeneratingImageFlag) {
// 🆕 只用 isGeneratingImageFlag 来控制是否显示生图占位图
// isGeneratingImageFlag 由 chat.tsx 控制:延迟 3 秒后设置为 true,收到图片后设置为 false
if (isGeneratingImageFlag) {
return <ImageGenerationLoading imageCount={imageCount} maxImages={6} providerType="alibaba-image" modelName="智能处理" />;
}
// 否则显示思考动画
// 否则显示思考动画(在等待 AI 分析或延迟期间)
return <ThinkingMessage />;
}