Fix update checker _checker.stopCurrentCheck is not function (#5089)

This commit is contained in:
Northword 2025-03-12 18:18:59 +08:00 • committed by GitHub
parent de24306c90
commit 2d95cad479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -644,6 +644,7 @@ var gCheckingPage = {
* this so we can cancel the update check if the user closes the window.
*/
_checker: null,
_checkId: null,
/**
* Initialize
@ -657,6 +658,7 @@ var gCheckingPage = {
Ci.nsIUpdateChecker
);
let check = await this._checker.checkForUpdates(this._checker.FOREGROUND_CHECK);
this._checkId = check.id
let result;
try {
result = await makeAbortable(check.result);
@ -664,7 +666,8 @@ var gCheckingPage = {
catch (e) {
// If we are aborting, stop the update check on our way out.
if (e instanceof AbortError) {
this._checker.stopCheck(check.id);
this._checker.stopCheck(this._checkId);
this._checkId = null;
}
throw e;
}
@ -762,7 +765,8 @@ var gCheckingPage = {
* Manager control, so stop checking for updates.
*/
onWizardCancel() {
this._checker.stopCurrentCheck();
this._checker.stopCheck(this._checkId);
this._checkId = null;
},
};