MCPcopy
hub / github.com/CapSoftware/Cap / appendRecordedClip

Function appendRecordedClip

apps/desktop/src/routes/editor/Editor.tsx:297–313  ·  view source on GitHub ↗
(recordingPath: string)

Source from the content-addressed store, hash-verified

295 });
296
297 const appendRecordedClip = async (recordingPath: string) => {
298 const toastId = toast.loading("Adding clip…");
299 try {
300 if (editorState.playing) {
301 await commands.stopPlayback();
302 setEditorState("playing", false);
303 }
304 await commands.setProjectConfig(serializeProjectConfiguration(project));
305 await commands.addExistingRecordingToEditor(recordingPath);
306 await commands.deleteRecordingDirectory(recordingPath).catch(() => {});
307 toast.success("Clip added", { id: toastId });
308 window.location.reload();
309 } catch (error) {
310 const message = error instanceof Error ? error.message : String(error);
311 toast.error(`Failed to add clip: ${message}`, { id: toastId });
312 }
313 };
314
315 const isExportMode = () => {
316 const d = dialog();

Callers 1

InnerFunction · 0.85

Calls 1

Tested by

no test coverage detected