forked from 77media/video-flow
修复暂停/播放按钮的显示逻辑,确保在特定步骤下正确渲染。同时,优化剧本初始化逻辑,仅在当前步骤为0时执行初始化。
This commit is contained in:
parent
4e21aea1a0
commit
cd14719111
@ -233,7 +233,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
|
||||
{/* 暂停/播放按钮 */}
|
||||
{
|
||||
(currentStep !== '6' && scriptData && scriptData.length > 0) && (
|
||||
(currentStep !== '6' && currentStep !== '0') && (
|
||||
<div className="absolute right-12 bottom-16 z-[49] flex gap-4">
|
||||
<GlassIconButton
|
||||
icon={isPauseWorkFlow ? Play : Pause}
|
||||
|
||||
@ -103,13 +103,15 @@ export function useWorkflowData() {
|
||||
} = useScriptService();
|
||||
// 初始化剧本
|
||||
useUpdateEffect(() => {
|
||||
console.log('开始初始化剧本', originalText,episodeId);
|
||||
// TODO 为什么一开始没项目id
|
||||
originalText && initializeFromProject(episodeId, originalText).then(() => {
|
||||
console.log('应用剧本');
|
||||
// 自动模式下 应用剧本;手动模式 需要点击 下一步 触发
|
||||
mode.includes('auto') && applyScript();
|
||||
});
|
||||
if (currentStep === '0') {
|
||||
console.log('开始初始化剧本', originalText,episodeId);
|
||||
// TODO 为什么一开始没项目id
|
||||
originalText && initializeFromProject(episodeId, originalText).then(() => {
|
||||
console.log('应用剧本');
|
||||
// 自动模式下 应用剧本;手动模式 需要点击 下一步 触发
|
||||
mode.includes('auto') && applyScript();
|
||||
});
|
||||
}
|
||||
}, [originalText], {mode: 'none'});
|
||||
// 监听剧本加载完毕
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user