Only cancel the install of the extension being cancelled

This commit is contained in:
AntsyLich
2026-10-12 13:56:33 +06:00
parent 649fc83ffa
commit ae749bb4f8
2 changed files with 4 additions and 1 deletions
@@ -127,8 +127,10 @@ abstract class Installer(private val service: Service) {
*/
private fun cancelQueue(downloadId: Long) {
val waitingInstall = this.waitingInstall.load()
// Every new install cancels its own previous attempt first, which mustn't hit another extension's install
val toCancel = synchronized(queue) { queue.find { it.downloadId == downloadId } }
?: waitingInstall ?: return
?: waitingInstall?.takeIf { it.downloadId == downloadId }
?: return
if (cancelEntry(toCancel)) {
queue.remove(toCancel)
if (waitingInstall == toCancel) {