From 607f9814a0c69a8ea7e6df2955589ec6c75ebc15 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:33:25 +0800 Subject: [PATCH] Fix uncaught errors on item.save() coming from attachmentBox --- chrome/content/zotero/elements/attachmentBox.js | 4 ++-- chrome/content/zotero/elements/attachmentsBox.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/elements/attachmentBox.js b/chrome/content/zotero/elements/attachmentBox.js index b6b72ac9bb..a7b6c4df7e 100644 --- a/chrome/content/zotero/elements/attachmentBox.js +++ b/chrome/content/zotero/elements/attachmentBox.js @@ -185,8 +185,8 @@ if (!(val instanceof Zotero.Item)) { throw new Error("'item' must be a Zotero.Item"); } - this._item = val; - if (this._item.isAttachment()) { + if (val.isAttachment()) { + this._item = val; this.hidden = false; this.render(); } diff --git a/chrome/content/zotero/elements/attachmentsBox.js b/chrome/content/zotero/elements/attachmentsBox.js index cd23b3e2eb..a0f7e0eab8 100644 --- a/chrome/content/zotero/elements/attachmentsBox.js +++ b/chrome/content/zotero/elements/attachmentsBox.js @@ -180,7 +180,6 @@ else { this._attachments.insertBefore(row, this._attachments.children[index]); } - console.log("attch box addRow", attachment, open, row); return row; }