diff --git a/components/pages/work-flow/ai-editing-iframe.tsx b/components/pages/work-flow/ai-editing-iframe.tsx index fcd8a4f..eb293ab 100644 --- a/components/pages/work-flow/ai-editing-iframe.tsx +++ b/components/pages/work-flow/ai-editing-iframe.tsx @@ -84,7 +84,6 @@ export const AIEditingIframe: React.FC = ({ const [isProcessing, setIsProcessing] = useState(false); const iframeRef = useRef(null); const progressIntervalRef = useRef(null); - const timeoutRef = useRef(null); // 构建智能剪辑URL const aiEditingUrl = `https://smartcut.movieflow.ai/ai-editor/${projectId}?token=${token}&user_id=${userId}&auto=true&embedded=true`; @@ -124,11 +123,7 @@ export const AIEditingIframe: React.FC = ({ clearInterval(progressIntervalRef.current); progressIntervalRef.current = null; } - // 清理超时 - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - timeoutRef.current = null; - } + onComplete({ videoUrl: data.videoUrl, @@ -151,11 +146,7 @@ export const AIEditingIframe: React.FC = ({ clearInterval(progressIntervalRef.current); progressIntervalRef.current = null; } - // 清理超时 - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - timeoutRef.current = null; - } + onError(data.error); break; @@ -182,11 +173,7 @@ export const AIEditingIframe: React.FC = ({ clearInterval(progressIntervalRef.current); progressIntervalRef.current = null; } - // 清理超时 - if (timeoutRef.current) { - clearTimeout(timeoutRef.current); - timeoutRef.current = null; - } + }; }, [onComplete, onError, onProgress]);