Changes to note insertion for MacWord
This commit is contained in:
parent
45a3e96e68
commit
06e1c404bd
1 changed files with 10 additions and 2 deletions
|
@ -1371,10 +1371,18 @@ Zotero.Integration.Session.prototype.cite = async function (field) {
|
|||
await citationsByItemIDPromise;
|
||||
|
||||
let citations = await this._insertCitingResult(fieldIndex, field, io.citation);
|
||||
// We need to re-update from document because we've inserted multiple fields.
|
||||
// Don't worry, the field list and info is cached so this triggers no calls to the doc.
|
||||
if (citations.length > 1) {
|
||||
// We need to refetch fields because we've inserted multiple.
|
||||
// This is not super optimal, but you're inserting 2+ citations at the time,
|
||||
// so that sets it off
|
||||
var fields = await this.getFields(true);
|
||||
}
|
||||
// And resync citations with ones in the doc
|
||||
await this.updateFromDocument(FORCE_CITATIONS_FALSE);
|
||||
for (let citation of citations) {
|
||||
if (fields) {
|
||||
citation._field = new Zotero.Integration.CitationField(fields[citation._fieldIndex]);
|
||||
}
|
||||
await this.addCitation(citation._fieldIndex, await citation._field.getNoteIndex(), citation);
|
||||
}
|
||||
return citations;
|
||||
|
|
Loading…
Reference in a new issue