From 45630213d312458cdd3c5207de39cdbaef3bd05a Mon Sep 17 00:00:00 2001 From: Tuomas Airaksinen Date: Thu, 10 Aug 2023 20:35:55 +0300 Subject: [PATCH] Fix crashing rewind --- .../service/device/speak/GeneralSpeakTextProvider.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/net/bible/service/device/speak/GeneralSpeakTextProvider.kt b/app/src/main/java/net/bible/service/device/speak/GeneralSpeakTextProvider.kt index d3f12afc38..f73723d9fb 100644 --- a/app/src/main/java/net/bible/service/device/speak/GeneralSpeakTextProvider.kt +++ b/app/src/main/java/net/bible/service/device/speak/GeneralSpeakTextProvider.kt @@ -358,7 +358,7 @@ class GeneralSpeakTextProvider( val lastTitle = this.lastVerseWithTitle reset() val rewindAmount = amount?: SpeakSettings.RewindAmount.SMART - val minimumOrdinal = book.ordinalRangeFor(startKey).first + val minimumOrdinal = book.ordinalRangeFor(startKey.key).first when(rewindAmount) { SpeakSettings.RewindAmount.SMART -> { @@ -410,12 +410,8 @@ class GeneralSpeakTextProvider( reset() val rewindAmount = amount?: SpeakSettings.RewindAmount.SMART when(rewindAmount) { - SpeakSettings.RewindAmount.SMART -> { - currentKey = getNextKey(startKey) - - } - SpeakSettings.RewindAmount.ONE_VERSE -> - currentKey = getNextOrdinal(startKey) + SpeakSettings.RewindAmount.SMART -> currentKey = startKey.next + SpeakSettings.RewindAmount.ONE_VERSE -> currentKey = getNextOrdinal(startKey) SpeakSettings.RewindAmount.TEN_VERSES -> { currentKey = startKey for (i in 1..10) {