Skip to content

Commit

Permalink
move showMeter to class scope
Browse files Browse the repository at this point in the history
  • Loading branch information
fsimonjetz committed Jul 31, 2024
1 parent 76e0c08 commit 8c82e03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/transliteration/domain/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export function lineAccFromColumns({
acc.addColumnToken(
token,
index,
showMeter,
showIpa,
updatePhoneticPropsContext(column.content, index, phoneticProps),
_.isEmpty(_.intersection(token.uniqueLemma, highlightLemmas))
Expand All @@ -71,7 +70,7 @@ export function lineAccFromColumns({
acc
)
return acc
}, new LineAccumulator(isInLineGroup))
}, new LineAccumulator(isInLineGroup, showMeter))
}

export function numberOfColumns(columns: readonly TextLineColumn[]): number {
Expand Down
7 changes: 4 additions & 3 deletions src/transliteration/ui/LineAccumulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ export class LineAccumulator {
private protocol: Protocol | null = null
private isFirstWord = true
private isInLineGroup = false
private showMeter = false
lemmas: string[] = []

constructor(isInLineGroup?: boolean) {
constructor(isInLineGroup?: boolean, showMeter?: boolean) {
this.isInLineGroup = isInLineGroup || false
this.showMeter = showMeter || false
}

getColumns(maxColumns: number): React.ReactNode[] {
Expand Down Expand Up @@ -143,7 +145,6 @@ export class LineAccumulator {
addColumnToken(
token: Token,
index: number,
showMeter?: boolean,
showIpa?: boolean,
phoneticProps?: PhoneticProps,
bemModifiers: string[] = []
Expand All @@ -164,7 +165,7 @@ export class LineAccumulator {
this.pushToken(
token,
index,
showMeter,
this.showMeter,
showIpa,
phoneticProps,
bemModifiers
Expand Down
1 change: 0 additions & 1 deletion src/transliteration/ui/line-tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function LineTokens({
token,
index,
false,
false,
{},
highlightTokens.includes(index) ? ['highlight'] : []
)
Expand Down

0 comments on commit 8c82e03

Please sign in to comment.