From 18500b19d063d6053199c879b39f1dd88b9b42ca 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 cf04125ae6..15aef33b1b 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); };