Skip to content

Commit

Permalink
Fix #3143 (Jump to speak location does not work)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jan 18, 2024
1 parent be7f326 commit c64c3b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ class SpeakControl @Inject constructor(
MediaButtonHandler.release()
}

private var speakBook: Book? = null
private var speakKey: Key? = null
val speakBookAndKey: BookAndKey? get() = speakKey?.let {BookAndKey(it, speakBook) }

fun onEventMainThread(event: SpeakProgressEvent) {
speakKey = event.key
speakBook = event.book
if (AdvancedSpeakSettings.synchronize || event.forceFollow) {
val book = speakPageManager.currentPage.currentDocument
speakPageManager.setCurrentDocumentAndKey(book, event.key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ class SplitBibleArea(private val mainBibleActivity: MainBibleActivity): FrameLay
}
}),
launch = { _, _, _ ->
speakControl.speakPageManager.currentPage.bookAndKey?.let {
speakControl.speakBookAndKey?.let {
if (it.document?.bookCategory == BookCategory.BIBLE && window.pageManager.isVersePageShown) {
window.pageManager.setCurrentDocumentAndKey(null, it.key)
} else {
Expand Down

0 comments on commit c64c3b7

Please sign in to comment.