diff --git a/app/service/Interaction/ShotService.ts b/app/service/Interaction/ShotService.ts index 08010e4..cb2dd10 100644 --- a/app/service/Interaction/ShotService.ts +++ b/app/service/Interaction/ShotService.ts @@ -180,6 +180,8 @@ export const useShotService = (): UseShotService => { try { setLoading(true); + console.log('shotInfo-selectedSegment', selectedSegment); + // 调用API重新生成视频片段,返回任务状态信息 const taskResult = await vidoEditUseCase.regenerateVideoSegment( projectId, diff --git a/components/ui/shot-tab-content.tsx b/components/ui/shot-tab-content.tsx index 9e748bf..50eb4c4 100644 --- a/components/ui/shot-tab-content.tsx +++ b/components/ui/shot-tab-content.tsx @@ -56,10 +56,12 @@ export const ShotTabContent = (props: ShotTabContentProps) => { useEffect(() => { if (pendingRegeneration) { + console.log('pendingRegeneration', pendingRegeneration, shotData[selectedIndex]?.lens); regenerateVideoSegment(); setPendingRegeneration(false); + setIsRegenerate(false); } - }, [shotData[selectedIndex]?.lens]); + }, [pendingRegeneration]); // 监听当前选中index变化 useEffect(() => { @@ -179,7 +181,9 @@ export const ShotTabContent = (props: ShotTabContentProps) => { ...shotData[selectedIndex], lens: shotInfo }); - setPendingRegeneration(true); + setTimeout(() => { + setPendingRegeneration(true); + }, 1000); }; // 新增分镜