Skip to content

Commit

Permalink
cleaner code, change cascading ifs to when
Browse files Browse the repository at this point in the history
  • Loading branch information
davotoula committed Nov 16, 2024
1 parent f16143b commit 6c3200a
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,21 +483,10 @@ private fun FullBleedNoteCompose(
Spacer(modifier = Modifier.height(10.dp))

when (noteEvent) {
is BadgeDefinitionEvent -> {
BadgeDisplay(baseNote = baseNote)
}

is LongTextNoteEvent -> {
RenderLongFormHeaderForThread(noteEvent)
}

is WikiNoteEvent -> {
RenderWikiHeaderForThread(noteEvent, accountViewModel, nav)
}

is ClassifiedsEvent -> {
RenderClassifiedsReaderForThread(noteEvent, baseNote, accountViewModel, nav)
}
is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote)
is LongTextNoteEvent -> RenderLongFormHeaderForThread(noteEvent)
is WikiNoteEvent -> RenderWikiHeaderForThread(noteEvent, accountViewModel, nav)
is ClassifiedsEvent -> RenderClassifiedsReaderForThread(noteEvent, baseNote, accountViewModel, nav)
}

Row(
Expand Down

0 comments on commit 6c3200a

Please sign in to comment.