diff --git a/packages/apps/backend/src/sofie-core-connection/dataTransformers/PartTransformer.ts b/packages/apps/backend/src/sofie-core-connection/dataTransformers/PartTransformer.ts index 910ebab..2501a44 100644 --- a/packages/apps/backend/src/sofie-core-connection/dataTransformers/PartTransformer.ts +++ b/packages/apps/backend/src/sofie-core-connection/dataTransformers/PartTransformer.ts @@ -29,12 +29,9 @@ export class PartTransformer { private readonly corePartPieces = observable.map() - private readonly editedScripts = observable.map() - constructor(private transformers: Transformers) { makeObservable(this, { partIds: computed, - updateEditedScript: action, updateCorePart: action, updateCorePiece: action, updateCoreShowStyleBase: action, @@ -162,8 +159,6 @@ export class PartTransformer { } } - const editedScript = this.editedScripts.get(this.convertId(partId)) - return literal({ _id: partId, playlistId, @@ -185,18 +180,10 @@ export class PartTransformer { label: derived.displayLabel, }, scriptContents: derived.scriptContents, - editedScriptContents: editedScript, + editedScriptContents: undefined, }) }) - updateEditedScript(partId: Core.PartId, editedScript: ScriptContents | undefined) { - if (editedScript !== undefined) { - this.editedScripts.set(partId, editedScript) - } else { - this.editedScripts.delete(partId) - } - } - updateCorePart(partId: Core.PartId, part: Core.DBPart | undefined) { if (part) { if (!isEqual(this.coreParts.get(partId), part)) { diff --git a/packages/apps/client/src/components/ScriptEditor/Editor.tsx b/packages/apps/client/src/components/ScriptEditor/Editor.tsx index 7682135..3206db2 100644 --- a/packages/apps/client/src/components/ScriptEditor/Editor.tsx +++ b/packages/apps/client/src/components/ScriptEditor/Editor.tsx @@ -219,13 +219,13 @@ function makeNewEditorState(doc: Node): EditorState { updateModel((lineId, lineNodes) => { console.log(lineId, lineNodes) - const compiledMarkdown = toMarkdown(lineNodes) - console.log('markdown', compiledMarkdown) - + // Future: debounce? locking? require manual triggering of the save? const openRundown = RootAppStore.rundownStore.openRundown + if (openRundown) { + const compiledMarkdown = toMarkdown(lineNodes) - // TODO - debounce? require manual execution? - if (openRundown) openRundown.updatePartScript(lineId, compiledMarkdown) + openRundown.updatePartScript(lineId, compiledMarkdown) + } }), ], doc, diff --git a/packages/apps/client/src/model/UIRundown.ts b/packages/apps/client/src/model/UIRundown.ts index 8d5d7b0..9d95ef1 100644 --- a/packages/apps/client/src/model/UIRundown.ts +++ b/packages/apps/client/src/model/UIRundown.ts @@ -153,7 +153,5 @@ export class UIRundown { partId, script, }) - - // TODO - should this have any side effects? } }