fix(chapters): fixed crashing when seeking below 0 seconds

This commit is contained in:
Quickdesh 2024-02-10 15:27:14 -05:00
parent 706621f332
commit e5ea1e0787

View file

@ -55,7 +55,7 @@ class CurrentChapter(
if (this.chapters.isEmpty()) {
return
}
val chapter = this.chapters.last { it.time <= (value ?: 0F) }
val chapter = this.chapters.last { it.time <= (value ?: 0F).coerceAtLeast(0F) }
view.setComposeContent {
CurrentChapterComposable(
chapter = chapter,