Skip to content

Commit

Permalink
View Model: Remove RenderedPageInfo.run
Browse files Browse the repository at this point in the history
After the recent UI cleanup, this is no longer used
  • Loading branch information
SLaks committed Oct 20, 2024
1 parent cc5047c commit 3d7e5e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/view-model/aliyah-labeller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 1 addition & 11 deletions src/view-model/scroll-view-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3d7e5e8

Please sign in to comment.