From 524660e10b7a008e07e7df0f9722228d5907fc74 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Sat, 11 Jan 2025 09:17:56 +0100 Subject: [PATCH] Fix dense call to setItemDownloadPercentage freezes app (#4979) --- chrome/content/zotero/xpcom/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index cee7d04030..de448ba37f 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -64,7 +64,7 @@ Zotero.Sync.Storage = new function () { * @param {String} libraryKey * @param {Number|NULL} */ - this.setItemDownloadPercentage = function (libraryKey, percentage) { + this.setItemDownloadPercentage = Zotero.Utilities.throttle(function (libraryKey, percentage) { Zotero.debug("Setting image download percentage to " + percentage + " for item " + libraryKey); @@ -93,7 +93,7 @@ Zotero.Sync.Storage = new function () { } Zotero.Notifier.trigger('redraw', 'item', parentItem.id, { column: "hasAttachment" }); } - } + }, 100); function error(e) {