Skip to content

Commit

Permalink
fix: Fixed file library crash
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Oct 24, 2022
1 parent 1365961 commit 88417b2
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ class FileLibraryDialogFragment : ListPreferenceDialogFragmentCompat() {
)

withContext(Dispatchers.Main) {
if (newName == "Invalid")
showMessage(getString(R.string.filelibrary_resample_failed))
else
showMessage(getString(R.string.filelibrary_resample_complete, targetRate))
refresh()
try {
if (newName == "Invalid")
showMessage(getString(R.string.filelibrary_resample_failed))
else
showMessage(getString(R.string.filelibrary_resample_complete,
targetRate))
refresh()
}
catch (_: IllegalStateException) {
// Context may not be attached to fragment at this point
}
}
}
}
Expand Down Expand Up @@ -225,7 +231,10 @@ class FileLibraryDialogFragment : ListPreferenceDialogFragmentCompat() {
else {
// TODO refresh without closing
this.dismiss()
fileLibPreference.showDialog()
CoroutineScope(Dispatchers.Main).launch {
delay(50L)
fileLibPreference.showDialog()
}
}
}

Expand Down

0 comments on commit 88417b2

Please sign in to comment.