From d83ec19c231b5ccb620869b324752f05193550ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 14 Apr 2021 12:25:55 +0300 Subject: [PATCH] Do not try to open/close empty collection tree rows on + and - hotkeys Causes performance issues --- chrome/content/zotero/collectionTree.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/collectionTree.jsx b/chrome/content/zotero/collectionTree.jsx index ea31481b4b..4cd5979f51 100644 --- a/chrome/content/zotero/collectionTree.jsx +++ b/chrome/content/zotero/collectionTree.jsx @@ -999,6 +999,7 @@ var CollectionTree = class CollectionTree extends LibraryTree { } toggleOpenState = async (index) => { + if (this.isContainerEmpty(index)) return; if (this.isContainerOpen(index)) { return this._closeContainer(index); } @@ -2030,7 +2031,7 @@ var CollectionTree = class CollectionTree extends LibraryTree { } _closeContainer(row, skipMap) { - if (!this.isContainerOpen(row)) return; + if (!this.isContainerOpen(row) || this.isContainerEmpty(row)) return; this.selection.selectEventsSuppressed = true; let selectParent = this.getParentIndex(this.selection.focused);