mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 12:02:16 +02:00
Fix refresh of DeckPicker UI after a new collection import
The fix introduces a call to withCol {} to make sure the collection is open and available before any of the code that updates the UI in DeckPicker runs.
This commit is contained in:
parent
8e29b5a50b
commit
4bd2cd1e09
@ -2635,9 +2635,14 @@ open class DeckPicker :
|
||||
}
|
||||
|
||||
override fun onImportColpkg(colpkgPath: String?) {
|
||||
invalidateOptionsMenu()
|
||||
updateDeckList()
|
||||
importColpkgListener?.onImportColpkg(colpkgPath)
|
||||
launchCatchingTask {
|
||||
// as the current collection is closed before importing a new collection, make sure the
|
||||
// new collection is open before the code to update the DeckPicker ui runs
|
||||
withCol { }
|
||||
invalidateOptionsMenu()
|
||||
updateDeckList()
|
||||
importColpkgListener?.onImportColpkg(colpkgPath)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMediaSyncCompleted(data: SyncCompletion) {
|
||||
|
Loading…
Reference in New Issue
Block a user