mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 19:51:50 +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 eu.kanade.tachiyomi.util.system.notificationManager
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import okhttp3.internal.toImmutableMap
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
@ -121,7 +122,9 @@ class LibraryUpdateNotifier(private val context: Context) {
|
|||||||
*
|
*
|
||||||
* @param updates a list of manga with new updates.
|
* @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 {
|
GlobalScope.launch {
|
||||||
val notifications = ArrayList<Pair<Notification, Int>>()
|
val notifications = ArrayList<Pair<Notification, Int>>()
|
||||||
updates.forEach {
|
updates.forEach {
|
||||||
|
Loading…
Reference in New Issue
Block a user