Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(editor): generate unique IDs for split keyboard and caption segments

Richie McIlroy4d90f024c654
diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.ts
index 5182aab4d..4fb462240 100644
--- a/apps/desktop/src/routes/editor/context.ts
+++ b/apps/desktop/src/routes/editor/context.ts
@@ -433,6 +433,7 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
segments.splice(index + 1, 0, {
...segment,
+ id: `kb-split-${Date.now()}-${Math.random().toString(36).slice(2)}`,
start: segment.start + time,
end: segment.end,
});
@@ -472,6 +473,7 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
segments.splice(index + 1, 0, {
...segment,
+ id: `cap-split-${Date.now()}-${Math.random().toString(36).slice(2)}`,
start: segment.start + time,
end: segment.end,
});