Fixed Download Concurrency issue

Fixed image not showing up after reader is paused and resumed
This commit is contained in:
tom5079
2020-09-26 11:07:35 +09:00
parent f7c45df9a6
commit db074df0f7
9 changed files with 36 additions and 61 deletions

View File

@@ -39,7 +39,7 @@ class DownloadFolderNameDialogFragment : DialogFragment() {
@SuppressLint("InflateParams")
private fun build(): View {
val galleryID = Cache.instances.let { if (it.size() == 0) 1199708 else it.keyAt((0 until it.size()).random()) }
val galleryID = Cache.instances.let { if (it.size == 0) 1199708 else it.keys.elementAt((0 until it.size).random()) }
val galleryBlock = runBlocking {
Cache.getInstance(requireContext(), galleryID).getGalleryBlock()
}