(recordingPath: string)
| 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(); |
no test coverage detected