From cf18fe69a9ffef4945841d62d4031c9137f2c5f2 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 2 Jul 2025 10:45:19 -0400 Subject: [PATCH] Migrate Zotero.Promise.each() in quickCopy.js --- chrome/content/zotero/xpcom/quickCopy.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js index f75debd10b..4e63c904c8 100644 --- a/chrome/content/zotero/xpcom/quickCopy.js +++ b/chrome/content/zotero/xpcom/quickCopy.js @@ -60,23 +60,19 @@ Zotero.QuickCopy = new function () { // if an export format is selected if (Zotero.test) return; - _initPromise = // FIXME: fx140: replace call to Zotero.Promise.each() - Zotero.Promise.each([ - () => _loadOutputFormat(), - () => _loadNoteOutputFormat(), - () => this.loadSiteSettings() - ], f => f()); + _initPromise = (async () => { + await _loadOutputFormat(); + await _loadNoteOutputFormat(); + await this.loadSiteSettings(); + })(); }.bind(this)); }; this.uninit = function () { _initCancelled = true; - // Cancel load if in progress - if (_initPromise) { - // FIXME: fx140: replace call to Zotero.Promise instance method 'cancel()' - _initPromise.cancel(); - } + // TODO: fx140: We used to explicitly cancel the Bluebird _initPromise here + // Is it OK to let it complete? Zotero.Prefs.unregisterObserver(this._prefObserverID); };