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

Function getPreviewProjectConfig

apps/desktop/src/routes/editor/Editor.tsx:91–118  ·  view source on GitHub ↗
(
	project: ReturnType<typeof useEditorContext>["project"],
	editorState: ReturnType<typeof useEditorContext>["editorState"],
)

Source from the content-addressed store, hash-verified

89}
90
91function getPreviewProjectConfig(
92 project: ReturnType<typeof useEditorContext>["project"],
93 editorState: ReturnType<typeof useEditorContext>["editorState"],
94) {
95 const config = serializeProjectConfiguration(project);
96
97 if (!editorState.timeline.tracks.caption && config.captions) {
98 config.captions = {
99 ...config.captions,
100 settings: {
101 ...config.captions.settings,
102 enabled: false,
103 },
104 };
105 }
106
107 if (!editorState.timeline.tracks.keyboard && config.keyboard) {
108 config.keyboard = {
109 ...config.keyboard,
110 settings: {
111 ...config.keyboard.settings,
112 enabled: false,
113 },
114 };
115 }
116
117 return config;
118}
119
120export function Editor() {
121 const [projectPath] = createResource(() => commands.getEditorProjectPath());

Callers 2

doConfigUpdateFunction · 0.85
queueConfigFunction · 0.85

Calls 1

Tested by

no test coverage detected