AI问片关闭弹窗不中断

This commit is contained in:
mtvpls
2026-02-17 13:17:22 +08:00
parent f5d549a617
commit e4a76b3f9d
3 changed files with 59 additions and 22 deletions
+4 -2
View File
@@ -110,6 +110,7 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(function VideoCard
const [showMobileActions, setShowMobileActions] = useState(false);
const [searchFavorited, setSearchFavorited] = useState<boolean | null>(null); // 搜索结果的收藏状态
const [showAIChat, setShowAIChat] = useState(false);
const [isAIStreaming, setIsAIStreaming] = useState(false);
const [aiEnabled, setAiEnabled] = useState(false);
const [aiDefaultMessageWithVideo, setAiDefaultMessageWithVideo] = useState('');
const [showDetailPanel, setShowDetailPanel] = useState(false);
@@ -1490,11 +1491,12 @@ const VideoCard = forwardRef<VideoCardHandle, VideoCardProps>(function VideoCard
}}
/>
{/* AI问片面板 */}
{aiEnabled && showAIChat && (
{/* AI问片面板 - 只在打开或正在流式响应时渲染 */}
{aiEnabled && (showAIChat || isAIStreaming) && (
<AIChatPanel
isOpen={showAIChat}
onClose={() => setShowAIChat(false)}
onStreamingChange={setIsAIStreaming}
context={{
title: actualTitle,
year: actualYear,