diff --git a/src/view-model/aliyah-labeller.test.ts b/src/view-model/aliyah-labeller.test.ts index b90a1739..b337884d 100644 --- a/src/view-model/aliyah-labeller.test.ts +++ b/src/view-model/aliyah-labeller.test.ts @@ -87,7 +87,8 @@ async function dumpAliyot(runId: string) { if (nextPage.type === 'page') { // If a page does not have a run, keep going // (pass over the skipped page for תענית ציבור). - const nextPageRun = nextPage.run?.leining.date ?? targetDate + const nextPageRun = + nextPage.lines.find((o) => o.run)?.run?.leining.date ?? targetDate if (nextPageRun.date > targetDate.date) break } pages.push(nextPage) diff --git a/src/view-model/scroll-view-model.ts b/src/view-model/scroll-view-model.ts index a4637a37..341d44c9 100644 --- a/src/view-model/scroll-view-model.ts +++ b/src/view-model/scroll-view-model.ts @@ -18,16 +18,6 @@ import { AliyahLabeller } from './aliyah-labeller.ts' export interface RenderedPageInfo { type: 'page' lines: RenderedLineInfo[] - - /** - * The LeiningRun containing the first פסוק that begins in this page. - * This is used to render the header UI as the user scrolls. - * TODO(haftara): What about pages of נביא outside a הפטרה? - * This will be unset for a תענית ציבור, which can contain an entire - * page that is between runs. - * TODO: This should probably be deleted. - */ - run?: LeiningRun } /** Information to render a message between `RenderedPageInfo`s. */ @@ -204,7 +194,7 @@ export abstract class ScrollViewModel { labels: labeller.getLabelsForLine(run, verses), } }) - return { type: 'page', lines, run: lines.find((o) => o.run)?.run } + return { type: 'page', lines } } private findContainingAliyot(