From d7f5fe94d21a3b0846848ca3b6d7da49a407405e Mon Sep 17 00:00:00 2001 From: xiangyu <3170102889@zju.edu.cn> Date: Sun, 4 Dec 2022 18:04:52 +0800 Subject: [PATCH] fix: delay sync after modifications --- src/zotero/events.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/zotero/events.ts b/src/zotero/events.ts index 7485abe..9049a56 100644 --- a/src/zotero/events.ts +++ b/src/zotero/events.ts @@ -35,9 +35,12 @@ class ZoteroEvents extends AddonBase { syncIds.includes(id as number) ) as number[]; if (modifiedSyncIds.length > 0) { - this._Addon.SyncController.doSync( - Zotero.Items.get(modifiedSyncIds) - ); + // Delay so that item content is ready + setTimeout(() => { + this._Addon.SyncController.doSync( + Zotero.Items.get(modifiedSyncIds) + ); + }, 10000); Zotero.debug("Better Notes: sync planned."); } }