mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-19 19:42:17 +02:00
Fix hang when syncing media in new schema
Media syncing does not require a collection lock, and was mistakenly holding one. Probably closes #12912
This commit is contained in:
parent
854f328f6b
commit
1ebdb73dee
@ -249,7 +249,8 @@ private suspend fun handleMediaSync(
|
||||
.setPositiveButton("Background") { _, _ -> }
|
||||
.show()
|
||||
try {
|
||||
CollectionManager.getBackend().withProgress(
|
||||
val backend = CollectionManager.getBackend()
|
||||
backend.withProgress(
|
||||
extractProgress = {
|
||||
if (progress.hasMediaSync()) {
|
||||
text =
|
||||
@ -260,9 +261,7 @@ private suspend fun handleMediaSync(
|
||||
dialog.setMessage(text)
|
||||
},
|
||||
) {
|
||||
withCol {
|
||||
newBackend.syncMedia(auth)
|
||||
}
|
||||
backend.syncMedia(auth)
|
||||
}
|
||||
} finally {
|
||||
dialog.dismiss()
|
||||
|
Loading…
Reference in New Issue
Block a user