fix: Dismiss failed download notification before retrying

This commit is contained in:
Ahmad Ansori Palembani 2024-12-21 11:51:43 +07:00
parent fe666b614f
commit 33a84f7e39
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 6 additions and 1 deletions

View file

@ -610,6 +610,11 @@ class NotificationReceiver : BroadcastReceiver() {
) )
} }
internal fun dismissFailThenStartAppUpdatePendingJob(context: Context, url: String, notifyOnInstall: Boolean = false): PendingIntent {
dismissNotification(context, Notifications.ID_UPDATER_FAILED)
return startAppUpdatePendingJob(context, url, notifyOnInstall)
}
/** /**
* Returns [PendingIntent] that cancels the download for a Tachiyomi update * Returns [PendingIntent] that cancels the download for a Tachiyomi update
* *

View file

@ -233,7 +233,7 @@ internal class AppUpdateNotifier(private val context: Context) {
addAction( addAction(
R.drawable.ic_refresh_24dp, R.drawable.ic_refresh_24dp,
context.getString(MR.strings.retry), context.getString(MR.strings.retry),
NotificationReceiver.startAppUpdatePendingJob(context, url), NotificationReceiver.dismissFailThenStartAppUpdatePendingJob(context, url),
) )
// Cancel action // Cancel action
addAction( addAction(