Fixed downloader not fully cancelled after DownloadWorker.cancel() is called
This commit is contained in:
@@ -179,6 +179,11 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
||||
}.forEach {
|
||||
it.cancel()
|
||||
}
|
||||
client.dispatcher().runningCalls().filter {
|
||||
it.request().tag() is Pair<*, *>
|
||||
}.forEach {
|
||||
it.cancel()
|
||||
}
|
||||
|
||||
progress.clear()
|
||||
notification.clear()
|
||||
@@ -194,6 +199,11 @@ class DownloadWorker private constructor(context: Context) : ContextWrapper(cont
|
||||
}.forEach {
|
||||
it.cancel()
|
||||
}
|
||||
client.dispatcher().runningCalls().filter {
|
||||
((it.request().tag() as Pair<*, *>).first as Int) == galleryID
|
||||
}.forEach {
|
||||
it.cancel()
|
||||
}
|
||||
|
||||
progress.remove(galleryID)
|
||||
notification.remove(galleryID)
|
||||
|
||||
Reference in New Issue
Block a user