mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Fix crash when canceling library update with new chapters
This commit is contained in:
parent
06ee5439d1
commit
20e81073aa
@ -28,6 +28,7 @@ import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import okhttp3.internal.toImmutableMap
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.ArrayList
|
||||
|
||||
@ -121,7 +122,9 @@ class LibraryUpdateNotifier(private val context: Context) {
|
||||
*
|
||||
* @param updates a list of manga with new updates.
|
||||
*/
|
||||
fun showResultNotification(updates: Map<LibraryManga, Array<Chapter>>) {
|
||||
fun showResultNotification(newUpdates: Map<LibraryManga, Array<Chapter>>) {
|
||||
// create a copy of the list since it will be cleared by the time it is used
|
||||
val updates = newUpdates.toImmutableMap()
|
||||
GlobalScope.launch {
|
||||
val notifications = ArrayList<Pair<Notification, Int>>()
|
||||
updates.forEach {
|
||||
|
Loading…
Reference in New Issue
Block a user