Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(editor): preserve section markers with a single adjacent boundary

Richie McIlroy79e194835556
diff --git a/apps/desktop/src/routes/editor/Timeline/sectionMarker.ts b/apps/desktop/src/routes/editor/Timeline/sectionMarker.ts
index 9efb59edd..31a428ac4 100644
--- a/apps/desktop/src/routes/editor/Timeline/sectionMarker.ts
+++ b/apps/desktop/src/routes/editor/Timeline/sectionMarker.ts
@@ -56,11 +56,16 @@ export function getSectionMarker(
const leftTime = prevSegmentRecordingDuration - prevSegment.end;
const rightTime = nextSegment.start;
- const left = leftTime === 0 ? null : { type: "time", time: leftTime };
- const right = rightTime === 0 ? null : { type: "time", time: rightTime };
-
- if (left === null && right === null) return null;
+ const left: SectionMarker | null =
+ leftTime === 0 ? null : { type: "time", time: leftTime };
+ const right: SectionMarker | null =
+ rightTime === 0 ? null : { type: "time", time: rightTime };
+ if (left === null) {
+ if (right === null) return null;
+ return { type: "dual", left: null, right };
+ }
+ if (right === null) return { type: "dual", left, right: null };
return { type: "dual", left, right };
}
}