Skip to content

Open source CapCut alternative.

TypeScript

fix(site): stop the autosave loop on projects without a scene run

David Lee7a187f72bab
diff --git a/site/src/cut/components/Editor.tsx b/site/src/cut/components/Editor.tsx
index f4c18e21..f0c6067e 100644
--- a/site/src/cut/components/Editor.tsx
+++ b/site/src/cut/components/Editor.tsx
@@ -188,7 +188,9 @@ export function Editor({
s.notes.text !== last.notes?.text ||
s.notes.publishedAt !== last.notes?.publishedAt ||
s.notes.links.join("") !== (last.notes?.links ?? []).join("") ||
- s.genvideo !== (last.genvideo as unknown) ||
+ // Normalized like serializeDoc stores it (?? null): a project with no
+ // run holds undefined in state and null in the doc — not a change.
+ (s.genvideo ?? null) !== ((last.genvideo ?? null) as unknown) ||
s.projectName !== lastName;
if (!changed) return;
last = serializeDoc(s);