From 7466fa479f3f033e3f45910d8ccbfd1c24723e8a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 29 Jan 2025 01:06:45 -0500 Subject: [PATCH] =?UTF-8?q?fx128:=20Further=20tweaks=20to=20"Check=20for?= =?UTF-8?q?=20Updates=E2=80=A6"=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't use internal interface if we can help it Relevant Mozilla changes: https://bugzilla.mozilla.org/show_bug.cgi?id=1875502#c60 --- chrome/content/zotero/update/updates.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/update/updates.js b/chrome/content/zotero/update/updates.js index d2149cecc1..2d914d21a4 100644 --- a/chrome/content/zotero/update/updates.js +++ b/chrome/content/zotero/update/updates.js @@ -526,7 +526,7 @@ var gUpdates = { * @param aCallback * A callback to pass the object to be displayed first to. */ - getStartPageID(aCallback) { + async getStartPageID(aCallback) { if ("arguments" in window && window.arguments[0]) { var arg0 = window.arguments[0]; if (arg0 instanceof Ci.nsIUpdate) { @@ -600,7 +600,7 @@ var gUpdates = { var um = Cc["@mozilla.org/updates/update-manager;1"].getService( Ci.nsIUpdateManager ); - let activeUpdate = um.internal.downloadingUpdate || um.internal.readyUpdate; + let activeUpdate = await um.getDownloadingUpdate() || await um.getReadyUpdate(); if (activeUpdate) { this.setUpdate(activeUpdate); aCallback("downloading"); @@ -738,8 +738,8 @@ var gCheckingPage = { LOG("gCheckingPage:onPageShow - Got user approval. Proceeding with download"); // If we resolved because of `aus.stateTransition`, we may actually be // downloading a different update now. - if (this.um.internal.downloadingUpdate) { - this.#update = this.um.internal.downloadingUpdate; + if (await this.um.getDownloadingUpdate()) { + this.#update = await this.um.getDownloadingUpdate(); } } else { LOG( @@ -919,7 +919,7 @@ var gDownloadingPage = { /** * Initialize */ - onPageShow() { + async onPageShow() { this._downloadStatus = document.getElementById("downloadStatus"); this._downloadProgress = document.getElementById("downloadProgress"); this._label_downloadStatus = this._downloadStatus.textContent; @@ -927,7 +927,7 @@ var gDownloadingPage = { var um = Cc["@mozilla.org/updates/update-manager;1"].getService( Ci.nsIUpdateManager ); - var activeUpdate = um.internal.downloadingUpdate || um.internal.readyUpdate; + var activeUpdate = await um.getDownloadingUpdate() || await um.getReadyUpdate(); if (activeUpdate) { gUpdates.setUpdate(activeUpdate);