Use app scoped CoroutineScope (#3403)
This commit is contained in:
@@ -28,6 +28,8 @@ import eu.kanade.tachiyomi.util.system.cancelNotification
|
||||
import eu.kanade.tachiyomi.util.system.getBitmapOrNull
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notify
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import tachiyomi.core.common.Constants
|
||||
import tachiyomi.core.common.i18n.pluralStringResource
|
||||
import tachiyomi.core.common.i18n.stringResource
|
||||
@@ -44,7 +46,7 @@ import java.text.NumberFormat
|
||||
|
||||
class LibraryUpdateNotifier(
|
||||
private val context: Context,
|
||||
|
||||
private val scope: CoroutineScope = Injekt.get(),
|
||||
private val securityPreferences: SecurityPreferences = Injekt.get(),
|
||||
private val sourceManager: SourceManager = Injekt.get(),
|
||||
) {
|
||||
@@ -209,7 +211,7 @@ class LibraryUpdateNotifier(
|
||||
|
||||
// Per-manga notification
|
||||
if (!securityPreferences.hideNotificationContent.get()) {
|
||||
launchUI {
|
||||
scope.launch {
|
||||
context.notify(
|
||||
updates.map { (manga, chapters) ->
|
||||
NotificationManagerCompat.NotificationWithIdAndTag(
|
||||
|
||||
Reference in New Issue
Block a user