Skip to content

Commit

Permalink
Import verse fix (#1141)
Browse files Browse the repository at this point in the history
* Accounts for Completable and runs resetNarratableList on UI thread

* Sets openLoadingModalProperty in runLater
  • Loading branch information
darrellcolehill authored May 13, 2024
1 parent f3398f3 commit ec44191
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,15 @@ class NarrationViewModel : ViewModel() {

fun importVerseAudio(verseIndex: Int, file: File) {
showLoadingDialog()

narration.onEditVerse(verseIndex, file)

resetNarratableList()
openLoadingModalProperty.set(false)
.doFinally {
runLater {
resetNarratableList()
openLoadingModalProperty.set(false)
}
}
.subscribeOn(Schedulers.io())
.subscribe()
}

private fun stopPlayer() {
Expand Down Expand Up @@ -1230,7 +1234,7 @@ class NarrationViewModel : ViewModel() {
}
}
}

private fun showLoadingDialog(messageKey: String = "savingProjectWait") {
loadingModalTextProperty.set(messages[messageKey])
openLoadingModalProperty.set(true)
Expand Down

0 comments on commit ec44191

Please sign in to comment.