From 9575b774d0a941c2b399f82e97882b4738c62049 Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Thu, 30 Apr 2026 07:09:49 +0200 Subject: [PATCH] fix: Auto Edit no longer throws "setCompositionParams is not defined" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit handleAutoEdit referenced setCompositionParams and setShowPreviewModal — neither exists in ResultCard, leftovers from a prior refactor. Align it with handleSubtitle/handleHook: accumulate the generated effects into activeLayers and re-render the clip via renderInBrowser. Co-Authored-By: Claude Opus 4.7 (1M context) --- dashboard/src/components/ResultCard.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dashboard/src/components/ResultCard.jsx b/dashboard/src/components/ResultCard.jsx index 6457d99..a1ac9c4 100644 --- a/dashboard/src/components/ResultCard.jsx +++ b/dashboard/src/components/ResultCard.jsx @@ -88,8 +88,17 @@ export default function ResultCard({ clip, index, jobId, uploadPostKey, uploadUs if (effectsRes.ok) { const data = await effectsRes.json(); if (data.effects && data.effects.segments) { - setCompositionParams(prev => ({ ...prev, effects: data.effects })); - setShowPreviewModal(true); + const newLayers = { ...activeLayers, effects: data.effects }; + setActiveLayers(newLayers); + const blobUrl = await renderInBrowser({ + videoUrl: originalVideoUrl, + durationInSeconds: clipDuration, + subtitles: newLayers.subtitles, + hook: newLayers.hook, + effects: newLayers.effects, + }); + setCurrentVideoUrl(blobUrl); + if (videoRef.current) videoRef.current.load(); return; } }