diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 456adfa..6e262a3 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -61,6 +61,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = const [isPauseWorkFlow, setIsPauseWorkFlow] = useState(false); const [canGoToCut, setCanGoToCut] = useState(false); const [isShowError, setIsShowError] = useState(false); + const [isGenerateEditPlan, setIsGenerateEditPlan] = useState(false); const [state, setState] = useState({ mode: 'automatic' as 'automatic' | 'manual' | 'auto', originalText: '', @@ -134,6 +135,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = try { await getGenerateEditPlan({ project_id: episodeId }); console.error('生成剪辑计划成功'); + setIsGenerateEditPlan(true); localStorage.setItem(`isLoaded_plan_${episodeId}`, 'true'); isLoadedRef.current = 'true'; setNeedStreamData(true); @@ -142,6 +144,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = } catch (error) { console.error('生成剪辑计划失败:', error); setNeedStreamData(true); + setIsGenerateEditPlan(false); } }, [episodeId, onEditPlanGenerated]); @@ -645,7 +648,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = fallbackToStep, originalText: state.originalText, // showGotoCutButton: from && currentLoadingText.includes('Post-production') ? true : false, - showGotoCutButton: canGoToCut ? true : false, + showGotoCutButton: canGoToCut && isGenerateEditPlan ? true : false, generateEditPlan: openEditPlan, handleRetryVideo };