优化 重生分镜 交互

This commit is contained in:
北枳 2025-08-19 04:22:08 +08:00
parent 83e264f5e2
commit b6e230b937

View File

@ -57,9 +57,10 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
useEffect(() => {
if (pendingRegeneration) {
console.log('pendingRegeneration', pendingRegeneration, shotData[selectedIndex]?.lens);
regenerateVideoSegment();
setPendingRegeneration(false);
setIsRegenerate(false);
regenerateVideoSegment().then(() => {
setPendingRegeneration(false);
setIsRegenerate(false);
});
}
}, [pendingRegeneration]);
@ -243,12 +244,12 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
whileHover={{ scale: 1.02 }}
whileTap={{ scale: 0.98 }}
>
{shot.status === 0 && (
{(shot.status === 0 || shot.videoUrl.length === 0) && (
<div className="w-full h-full flex items-center justify-center">
<Loader2 className="w-4 h-4 animate-spin text-blue-500" />
</div>
)}
{shot.status === 1 && shot.videoUrl[0] ? (
{shot.status === 1 && shot.videoUrl[0] && (
<video
src={shot.videoUrl[0].video_url}
key={shot.videoUrl[0].video_url}
@ -259,10 +260,6 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
onMouseEnter={(e) => e.currentTarget.play()}
onMouseLeave={(e) => e.currentTarget.pause()}
/>
) : (
<div className="w-full h-full flex items-center justify-center bg-red-500/10">
<CircleX className="w-4 h-4 text-red-500" />
</div>
)}
{/* 任务失败 */}
{shot.status === 2 && (
@ -397,7 +394,7 @@ export const ShotTabContent = (props: ShotTabContentProps) => {
</motion.div>
)}
</AnimatePresence>
{(shotData[selectedIndex]?.status === 2 || !shotData[selectedIndex]?.videoUrl.length) && (
{(shotData[selectedIndex]?.status === 2) && (
<div className="w-full h-full flex gap-1 items-center justify-center rounded-lg bg-red-500/10">
<CircleX className="w-4 h-4 text-red-500" />
<span className="text-white/50">Failed, click to regenerate</span>