fix: canceling job didn't hide status banner
This commit is contained in:
parent
27e5ff2c4a
commit
5a3c6dae4a
3 changed files with 14 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.util.system.isRunning
|
||||||
import eu.kanade.tachiyomi.util.system.setForegroundSafely
|
import eu.kanade.tachiyomi.util.system.setForegroundSafely
|
||||||
import eu.kanade.tachiyomi.util.system.workManager
|
import eu.kanade.tachiyomi.util.system.workManager
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import tachiyomi.core.common.i18n.stringResource
|
import tachiyomi.core.common.i18n.stringResource
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
|
|
@ -108,6 +109,10 @@ class BackupRestoreJob(private val context: Context, workerParams: WorkerParamet
|
||||||
|
|
||||||
fun stop(context: Context) {
|
fun stop(context: Context) {
|
||||||
context.workManager.cancelUniqueWork(TAG)
|
context.workManager.cancelUniqueWork(TAG)
|
||||||
|
// KMK -->
|
||||||
|
val backupRestoreStatus: BackupRestoreStatus = Injekt.get()
|
||||||
|
runBlocking { backupRestoreStatus.stop() }
|
||||||
|
// KMK <--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -877,6 +877,10 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
|
||||||
// Should only return one work but just in case
|
// Should only return one work but just in case
|
||||||
.forEach {
|
.forEach {
|
||||||
wm.cancelWorkById(it.id)
|
wm.cancelWorkById(it.id)
|
||||||
|
// KMK -->
|
||||||
|
val libraryUpdateStatus: LibraryUpdateStatus = Injekt.get()
|
||||||
|
runBlocking { libraryUpdateStatus.stop() }
|
||||||
|
// KMK <--
|
||||||
|
|
||||||
// Re-enqueue cancelled scheduled work
|
// Re-enqueue cancelled scheduled work
|
||||||
if (it.tags.contains(WORK_NAME_AUTO)) {
|
if (it.tags.contains(WORK_NAME_AUTO)) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.util.system.cancelNotification
|
||||||
import eu.kanade.tachiyomi.util.system.isRunning
|
import eu.kanade.tachiyomi.util.system.isRunning
|
||||||
import eu.kanade.tachiyomi.util.system.setForegroundSafely
|
import eu.kanade.tachiyomi.util.system.setForegroundSafely
|
||||||
import eu.kanade.tachiyomi.util.system.workManager
|
import eu.kanade.tachiyomi.util.system.workManager
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import logcat.LogPriority
|
import logcat.LogPriority
|
||||||
import tachiyomi.core.common.util.system.logcat
|
import tachiyomi.core.common.util.system.logcat
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
|
|
@ -127,6 +128,10 @@ class SyncDataJob(private val context: Context, workerParams: WorkerParameters)
|
||||||
// Should only return one work but just in case
|
// Should only return one work but just in case
|
||||||
.forEach {
|
.forEach {
|
||||||
wm.cancelWorkById(it.id)
|
wm.cancelWorkById(it.id)
|
||||||
|
// KMK -->
|
||||||
|
val syncStatus: SyncStatus = Injekt.get()
|
||||||
|
runBlocking { syncStatus.stop() }
|
||||||
|
// KMK <--
|
||||||
|
|
||||||
// Re-enqueue cancelled scheduled work
|
// Re-enqueue cancelled scheduled work
|
||||||
if (it.tags.contains(TAG_AUTO)) {
|
if (it.tags.contains(TAG_AUTO)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue