mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Clarify variable name in Item#_updateAttachmentStates()
This commit is contained in:
parent
ea3f14f195
commit
2216729721
1 changed files with 7 additions and 5 deletions
|
|
@ -2824,7 +2824,7 @@ Zotero.Item.prototype._updateAttachmentStates = function (exists) {
|
|||
}
|
||||
|
||||
try {
|
||||
var item = this.ObjectsClass.getByLibraryAndKey(this.libraryID, parentKey);
|
||||
var parentItem = this.ObjectsClass.getByLibraryAndKey(this.libraryID, parentKey);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof Zotero.Exception.UnloadedDataException) {
|
||||
|
|
@ -2834,16 +2834,18 @@ Zotero.Item.prototype._updateAttachmentStates = function (exists) {
|
|||
}
|
||||
throw e;
|
||||
}
|
||||
if (!item) {
|
||||
if (!parentItem) {
|
||||
Zotero.logError(`Attachment parent ${this.libraryID}/${parentKey} doesn't exist`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.deleted && item._bestAttachmentState?.key && this.key === item._bestAttachmentState.key) {
|
||||
item._bestAttachmentState.exists = exists;
|
||||
if (!this.deleted
|
||||
&& parentItem._bestAttachmentState?.key
|
||||
&& this.key === parentItem._bestAttachmentState.key) {
|
||||
parentItem._bestAttachmentState.exists = exists;
|
||||
}
|
||||
else {
|
||||
item.clearBestAttachmentState();
|
||||
parentItem.clearBestAttachmentState();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue