mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
Migrate Zotero.Promise#isResolved() in citationDialog.js
This commit is contained in:
parent
e81f5d96f1
commit
c4a0a760b1
1 changed files with 3 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ const ItemTree = require('zotero/itemTree');
|
|||
const { getCSSIcon } = require('components/icons');
|
||||
const { COLUMNS } = require('zotero/itemTreeColumns');
|
||||
|
||||
var doc, io, ioReadyPromise, isCitingNotes, accepted;
|
||||
var doc, io, ioReadyPromise, ioIsReady, isCitingNotes, accepted;
|
||||
|
||||
// used for tests
|
||||
var loaded = false;
|
||||
|
|
@ -57,6 +57,7 @@ async function onLoad() {
|
|||
if (!ioReadyPromise) {
|
||||
ioReadyPromise = Zotero.Promise.resolve();
|
||||
}
|
||||
ioReadyPromise.then(() => ioIsReady = true);
|
||||
isCitingNotes = !!io.isCitingNotes;
|
||||
window.isPristine = true;
|
||||
|
||||
|
|
@ -1629,7 +1630,7 @@ const CitationDataManager = {
|
|||
// It can take arbitrarily long time for documents with many cited items to load
|
||||
// all data necessary to run io.sort().
|
||||
// Do nothing if io.sort() is not yet ready to run.
|
||||
if (!ioReadyPromise.isResolved()) return;
|
||||
if (!ioIsReady) return;
|
||||
Zotero.debug("Citation Dialog: sorting items");
|
||||
this.updateCitationObject();
|
||||
await io.sort();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue