diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt index d917161a3d..766ddf2f14 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt @@ -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>) { + fun showResultNotification(newUpdates: Map>) { + // 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>() updates.forEach {