diff --git a/apps/client/src/widgets/collections/presentation/model.ts b/apps/client/src/widgets/collections/presentation/model.ts index 031ff2f36..346adc505 100644 --- a/apps/client/src/widgets/collections/presentation/model.ts +++ b/apps/client/src/widgets/collections/presentation/model.ts @@ -21,8 +21,7 @@ export interface PresentationModel { export async function buildPresentationModel(note: FNote): Promise { const slideNotes = await note.getChildNotes(); const slides: PresentationSlideModel[] = await Promise.all(slideNotes.map(async slideNote => ({ - noteId: slideNote.noteId, - content: await processContent(slideNote), + ...(await buildSlideModel(slideNote)), verticalSlides: await buildVerticalSlides(slideNote) }))) @@ -33,14 +32,18 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise ({ - noteId: childNote.noteId, - content: await processContent(childNote) - }))); + const slides: PresentationSlideBaseModel[] = await Promise.all(children.map(buildSlideModel)); return slides; } +async function buildSlideModel(note: FNote): Promise { + return { + noteId: note.noteId, + content: await processContent(note) + } +} + async function processContent(note: FNote): Promise { const { $renderedContent } = await contentRenderer.getRenderedContent(note, {