fix: type-check presentation hierarchy projections
This commit is contained in:
@@ -241,6 +241,8 @@ const authoringPhaseForBeat = (beatId: string): AuthoringPhaseId => {
|
|||||||
const AuthoringScene = ({ scene, beat }: { scene: SceneDefinition; beat: SceneBeatDefinition }) => {
|
const AuthoringScene = ({ scene, beat }: { scene: SceneDefinition; beat: SceneBeatDefinition }) => {
|
||||||
const projection = projectPreparedAuthoringPhase(authoringPhaseForBeat(beat.id));
|
const projection = projectPreparedAuthoringPhase(authoringPhaseForBeat(beat.id));
|
||||||
const primaryCommand = projection.commands[0];
|
const primaryCommand = projection.commands[0];
|
||||||
|
// The prepared recording is the factual source for this public-operation label.
|
||||||
|
if (!primaryCommand) throw new Error(`Authoring phase ${projection.phase} has no public operation`);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export const beatVisualContractFor = (
|
|||||||
beatId: string,
|
beatId: string,
|
||||||
): SceneBeatVisualContract => {
|
): SceneBeatVisualContract => {
|
||||||
const key = `${sceneId}/${beatId}`;
|
const key = `${sceneId}/${beatId}`;
|
||||||
const contract = beatContracts[key];
|
const contract = beatContracts[key as keyof typeof beatContracts];
|
||||||
if (!contract) throw new Error(`No visual contract for ${key}`);
|
if (!contract) throw new Error(`No visual contract for ${key}`);
|
||||||
return { sceneId, beatId, ...contract };
|
return { sceneId, beatId, ...contract };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user