fix(download): Don't delay pause notification

This commit is contained in:
Ahmad Ansori Palembani 2024-12-20 08:05:19 +07:00
parent 12002f62cd
commit f985ad6daa
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.data.download
import android.content.Context
import android.os.Handler
import android.os.Looper
import co.touchlab.kermit.Logger
import com.hippo.unifile.UniFile
@ -93,8 +92,6 @@ class Downloader(
private val _queueState = MutableStateFlow<List<Download>>(emptyList())
val queueState = _queueState.asStateFlow()
private val handler = Handler(Looper.getMainLooper())
/**
* Notifier for the downloader state and progress.
*/
@ -158,7 +155,7 @@ class Downloader(
}
if (isPaused && queueState.value.isNotEmpty()) {
handler.postDelayed({ notifier.onDownloadPaused() }, 150)
notifier.onDownloadPaused()
} else {
notifier.dismiss()
}