Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Sep 2, 2023
1 parent 75148f6 commit f90df62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ open class CurrentPageManager @Inject constructor(
*/
fun setFirstUseDefaultVerse() {
currentBible.setCurrentDocument(defaultBible)
currentBible.doSetKey(defaultVerse)
currentBible.doSetKey(defaultVerse.start)
}

/**
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/net/bible/service/common/CommonUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,11 @@ object CommonUtils : CommonUtilsBase() {

val defaultBible get() = Books.installed().getBooks { it.bookCategory == BookCategory.BIBLE }[0] as SwordBook
val defaultVerse: VerseRange get() {
val (otVerse, ntVerse, psVerse) = listOf("Gen.1.1-Gen.1.3", "Joh.3.16-Joh.3.18", "Ps.1.1-Ps.1.3").map { VerseRangeFactory.fromString(KJVA, it).toV11n(defaultBible.versification) }
val (otVerse, ntVerse, psVerse) =
listOf("Gen.1.1-Gen.1.3", "Joh.3.16-Joh.3.18", "Ps.1.1-Ps.1.3")
.map {
VerseRangeFactory.fromString(KJVA, it).toV11n(defaultBible.versification)
}
return when {
defaultBible.contains(ntVerse.start) -> ntVerse
defaultBible.contains(otVerse.start) -> otVerse
Expand Down

0 comments on commit f90df62

Please sign in to comment.